Bug 1302 - CLKernel missing several constants used to access clGetKernelWorkGroupInfo
Summary: CLKernel missing several constants used to access clGetKernelWorkGroupInfo
Status: RESOLVED FIXED
Alias: None
Product: Jocl
Classification: JogAmp
Component: opencl (show other bugs)
Version: 2.5.0
Hardware: All all
: P4 normal
Assignee: Wade Walker
URL:
Depends on:
Blocks:
 
Reported: 2016-04-12 02:58 CEST by Wade Walker
Modified: 2023-07-12 01:52 CEST (History)
4 users (show)

See Also:
Type: DEFECT
SCM Refs:
Workaround: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wade Walker 2016-04-12 02:58:58 CEST
We're missing several constants for newer versions of CL, like CL_KERNEL_COMPILE_WORK_GROUP_SIZE. Add new functions for these, and make sure there aren't any others missing.
Comment 1 ArToX 2016-04-12 09:25:58 CEST
Thanks Wade,

Also feel free to check presence or add other methods for other bindings

    public static final int CL_KERNEL_COMPILE_WORK_GROUP_SIZE = 4529;
    public static final int CL_KERNEL_CONTEXT = 4499;
    public static final int CL_KERNEL_FUNCTION_NAME = 4496;
    public static final int CL_KERNEL_LOCAL_MEM_SIZE = 4530;
    public static final int CL_KERNEL_NUM_ARGS = 4497;
    public static final int CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE = 4531;
    public static final int CL_KERNEL_PRIVATE_MEM_SIZE = 4532;
    public static final int CL_KERNEL_PROGRAM = 4500;
    public static final int CL_KERNEL_REFERENCE_COUNT = 4498;
    public static final int CL_KERNEL_WORK_GROUP_SIZE = 4528;

or switch the getWorkGroupInfo() to public.
Comment 2 Wade Walker 2016-04-12 22:34:53 CEST
Yes, I plan to add those others, I just need to check that those constants are getting properly translated from the CL header files. There may be a little weirdness because there's only one version of CLKernel, but there are three versions of the CL object (for v1.1, v1.2, and v2.0), so I'll need to throw an error if you try to query a non-existent value on an older CL version, but that's no big deal.
Comment 3 Wade Walker 2016-04-18 02:40:05 CEST
I've checked in the fix on my version of the JOCL repo, you can see the commit at https://github.com/WadeWalker/jocl/commit/7a26673570fd77839672d472b04dbd509395de5b.

For now, what I've done is add new functions for CL_KERNEL_PREFERRED_WORK_GROUP_SIZE_MULTIPLE and CL_KERNEL_PRIVATE_MEM_SIZE, since those two were added in OpenCL 1.1, which is the version the Java OpenCL objects (the "high-level interface") present to the user.

For later ones such as CL_KERNEL_GLOBAL_WORK_SIZE (introduced in OpenCL 1.2) I included a new test that shows how to access them. Essentially, you just call the raw OpenCL function instead of using an OO method.

Right now our cluster is offline, so I'll have to build you an unofficial release. Which platform and bit-width do you need this for? I'll build it and send you a download link via email.
Comment 4 ArToX 2016-04-18 08:35:36 CEST
Hi Wade,

Thanks for the fix, i'm using a win64 platform. I'll check your git and try the release you'll send me.

Thanks a lot.
Comment 5 Wade Walker 2016-04-20 04:09:53 CEST
Having a spot of difficulty building the new library, I get some access violations on Windows 10, which I hadn't tested on before (though it works on Windows 7). I need to track it down and make sure this isn't a general problem with JOCL on Windows 10, so it may take another few days depending on what's wrong.
Comment 6 Wade Walker 2016-04-23 18:01:14 CEST
I created a test build and send it as a Dropbox link to the bug reporter. We'll see if it works for him too. I'm getting some HotSpot crashes in JOCL with the latest nvidia drivers on 64-bit Windows 10, but these seem to be unrelated as far as I can tell. I'm working on that as a separate problem.
Comment 7 ArToX 2016-04-29 17:04:56 CEST
Thanks i'll try it soon, I was a bit off the subject last week.
Comment 8 Sven Gothel 2023-07-12 01:52:32 CEST
finally merged w/ Wade's master branch of 2016 :)