Edit: Problem solved! rzymek's answer was helpful.
Question: For JOCL, how can I exclude some cores of CPU from the opencl calculations with device fission?(Java port of cl_device_partition_property seems to be corrupt for 0.1.9 version)
Edit: I found this:
clCreateSubDevices(devices[0][1],core , 1, cpuCores, coreIDs);
but java/jocl doesnt accept this:
cl_device_partition_property core=CL.CL_DEVICE_PARTITION_BY_COUNTS;
error is:
Type mismatch: cannot convert from int to cl_device_partition_property
Just tried null initialization then using variables own methods to set the property:
cl_device_partition_property core = null;
core.addProperty(CL_DEVICE_PARTITION_BY_COUNTS, platforms[0]);
Edit: now it gives
java.lang.NullPointerException,
error.
IT needs to be unsigned int (not cl_device_partition_property) but java doesnt have it.
New try with a constructor:
cl_device_partition_property core = new cl_device_partition_property();
error:
A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000007fedb6500bf, pid=4952, tid=4852
#
# JRE version: 7.0_21-b11
# Java VM: Java HotSpot(TM) 64-Bit Server VM (23.21-b01 mixed mode windows-amd64 compressed oops)
# Problematic frame:
# C [amdocl64.dll+0x1800bf] clGetSamplerInfo+0x1972f
#
# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows
#
# An error report file with more information is saved as:
# C:\javalar\buraya\paralelProje\hs_err_pid4952.log
#
# If you would like to submit a bug report, please visit:
# http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#
[error occurred during error reporting , id 0xc0000005]
Another try:
cl_device_partition_property core = (CL_UNSIGNED_INT32)CL_DEVICE_PARTITION_BY_COUNTS;
error:
CL_UNSIGNED_INT32 cannot be resolved to a type
This did not work too:
Pointer xyz=Pointer.to(core); // jocl's pointer type.
clCreateSubDevices(device,xyz, 1, cpuCores, coreIDs);
Edit: problem solved! Thanks. Can partition my cpu now: