Hello, Some time ago i use CUDAfy for CUDA. I was very usefull. So now i try to write some code for OpenCL. And have a trouble with parameters to kernel function.
I try to reduce array size, try many other things...so after all i wrote test code, but it also have this trouble:
Thank you.
I try to reduce array size, try many other things...so after all i wrote test code, but it also have this trouble:
CudafyModule km = CudafyModule.TryDeserialize();
if (km == null || !km.TryVerifyChecksums())
{
km = CudafyTranslator.Cudafy();
km.Serialize();
}
CudafyModes.DeviceId = comboBox1.SelectedIndex; // selecting device (Videocard by default)
GPGPU gpu = CudafyHost.GetDevice(CudafyModes.Target, CudafyModes.DeviceId );
textBox1.AppendText(String.Format(Environment.NewLine + "Starting on Device {0} ( {1} )", CudafyModes.DeviceId, gpu.GetDeviceProperties(false).Name) );
gpu.LoadModule(km);
gpu.StartTimer();
UInt32[] partBuf = new UInt32[26];
UInt32[] dev_items = gpu.Allocate<UInt32>(partBuf); // at this pont we got dev_items size 0!!! is that right?!!
dim3 threads = new dim3(5, 6);
dim3 grids = new dim3(7, 8);
gpu.Launch(threads, grids).calc_db_units( 0, 0, 0, dev_items ); // at this point we've got an "OpenCL error code detected: InvalidArgumentSize." error message.
gpu.CopyFromDevice(dev_items, partBuf);
gpu.FreeAll();
gpu.StopTimer();
// Just test function...only for "doing something"...
[Cudafy]
public static void calc_db_units(GThread thread, UInt32 definer, UInt16 dp, UInt32 part, UInt32[] generated)
{
UInt64 currResult = (UInt64)thread.blockDim.x + ((UInt64)thread.blockDim.y << 8) + ((UInt64)thread.gridDim.x << 16) + ((UInt64)thread.gridDim.y);
generated[0] = (UInt32)(currResult);
generated[1] = (UInt32)(currResult >> 32);
}
So, what i've doing wrong?Thank you.