Yes, and I believe particles has one too. Anyway, I added the missing indices (which normally get converted to italic font tags) and enabled cl_amd_fp64 since I don't have support for the _khr_ one. Other than that the code should be the same.
I compiled the program, created the kernel and tried setting the fourth argument with a two-double struct but couldn't reproduce the issue.
Any other info on this problem?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
i changed my program to use doubles instead of floats to increase accuracy.
using double2 instead of float2 gives this exception.
I use…
Kernel.SetValueArgument(3, new Vector2D(-1.5, -1.5));
and this line gives invalid argument index exception.
this worked fine with my float2 vector type Vector2F.
**// enables double types ?
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
__kernel void GridUpdate
(
__global double2 * position,
__global int * particles,
double gridCellSize,
double2 domainMin,
int gridCellCountx
)
{
size_t i = get_global_id(0);
int2 cell = (int2)((position_ - domainMin) / gridCellSize);
particles = cell.x + gridCellCountx * cell.y;
}_**
Darn, I must have missed your post. I'm sorry.
Does your GPU support doubles?
I run this code on CPU instead of GPU during development. And my CPU supports doubles.
The error is only for "double2" typed arguments. "double" or "double2*" typed arguments works fine.
I can't compile your kernel at all. Problem is, I'm stuck with an old notebook for a couple of days.
What is your platform?
Sorry there is a typing error in that code.
__kernel void GridUpdate
(
__global double2 * position,
__global int * particles,
double gridCellSize,
double2 domainMin,
int gridCellCountx
)
{
size_t i = get_global_id(0);
int2 cell = (int2)((position_ - domainMin) / gridCellSize);
particles = cell.x + gridCellCountx * cell.y;
}_
i cant seem to write "position_" to forums_
there is an index in position and that doesnt show on forums.
Yes, and I believe particles has one too. Anyway, I added the missing indices (which normally get converted to italic font tags) and enabled cl_amd_fp64 since I don't have support for the _khr_ one. Other than that the code should be the same.
I compiled the program, created the kernel and tried setting the fourth argument with a two-double struct but couldn't reproduce the issue.
Any other info on this problem?