–edit–
Please dont dismiss this as off-forum. The OpenCL forum is very thinly populated and I have no hopes of finding an answer there.
All,
I am trying to understand the rationale behind OpenCL APIs and how they would map to CUDA.
I have a question on the following API.
Concerned API:
cl_program clCreateProgramWithBinary (cl_context context,
cl_uint num_devices,
const cl_device_id *device_list,
const size_t *lengths,
const void **binaries,
cl_int *binary_status,
cl_int *errcode_ret)
Documentation of clCreateProgramWithBinary() API says:
"
The program binaries specified by binaries contain the bits that describe the program executable
that will be run on the device(s) associated with context. The program binary can consist of
either or both:
Device-specific executable(s), and/or,
Implementation-specific intermediate representation (IR) which will be converted to the
device-specific executable
"
Is this binary - native code like “cubin” OR “OpenCL compiler generated binary for that device?”.
The OpenCL specification does NOT say much on these lines.
If this is a native binary, OpenCL already allows a native form of execution via “clEnqueNativeKernel()” API.
Any thoughts?
–edit–
Please dont dismiss this as off-forum. The OpenCL forum is very thinly populated and I have no hopes of finding an answer there.
All,
I am trying to understand the rationale behind OpenCL APIs and how they would map to CUDA.
I have a question on the following API.
Concerned API:
Documentation of clCreateProgramWithBinary() API says:
"
"
Is this binary - native code like “cubin” OR “OpenCL compiler generated binary for that device?”.
The OpenCL specification does NOT say much on these lines.
If this is a native binary, OpenCL already allows a native form of execution via “clEnqueNativeKernel()” API.
Any thoughts?
If worse comes to worse, you could just try to decompile the file with decuda, and see if it works. External Media
Well, if I had the file I dont have a problem at all.
I am looking @ what the spec is saying… There r no OpenCL implementations released AFAIK
–edit–
Please dont dismiss this as off-forum. The OpenCL forum is very thinly populated and I have no hopes of finding an answer there.
All,
I am trying to understand the rationale behind OpenCL APIs and how they would map to CUDA.
I have a question on the following API.
Concerned API:
Documentation of clCreateProgramWithBinary() API says:
"
"
Is this binary - native code like “cubin” OR “OpenCL compiler generated binary for that device?”.
The OpenCL specification does NOT say much on these lines.
If this is a native binary, OpenCL already allows a native form of execution via “clEnqueNativeKernel()” API.
Any thoughts?
I guess you have found the answer already, but here goes anyway. Section 2.2.1 of the “OpenCL Programming Guide for the CUDA Architecture” version 3.1 reads:
Kernels written in OpenCL C are compiled into PTX, which is CUDA’s instruction
set architecture and is described in a separate document.
Currently, the PTX intermediate representation can be obtained by calling
clGetProgramInfo() with CL_PROGRAM_BINARIES. It can be passed to
clCreateProgramWithBinary() to create a program object only if it is
produced and consumed by the same driver. This will likely not be supported in
future versions.
–edit–
Please dont dismiss this as off-forum. The OpenCL forum is very thinly populated and I have no hopes of finding an answer there.
All,
I am trying to understand the rationale behind OpenCL APIs and how they would map to CUDA.
I have a question on the following API.
Concerned API:
Documentation of clCreateProgramWithBinary() API says:
"
"
Is this binary - native code like “cubin” OR “OpenCL compiler generated binary for that device?”.
The OpenCL specification does NOT say much on these lines.
If this is a native binary, OpenCL already allows a native form of execution via “clEnqueNativeKernel()” API.
Any thoughts?
I guess you have found the answer already, but here goes anyway. Section 2.2.1 of the “OpenCL Programming Guide for the CUDA Architecture” version 3.1 reads:
Kernels written in OpenCL C are compiled into PTX, which is CUDA’s instruction
set architecture and is described in a separate document.
Currently, the PTX intermediate representation can be obtained by calling
clGetProgramInfo() with CL_PROGRAM_BINARIES. It can be passed to
clCreateProgramWithBinary() to create a program object only if it is
produced and consumed by the same driver. This will likely not be supported in
future versions.