diff options
author | Guo Yejun <yejun.guo@intel.com> | 2015-11-19 02:03:25 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-12-09 11:27:48 +0800 |
commit | e2c46c88bd5bbd9f5762ba7ad3eaf00257ad114f (patch) | |
tree | 54a9ae522998cfd8161be0b27e0cdaed4c1cf526 /src/cl_device_id.h | |
parent | d10f16e746f0c3cdc90ac25a0c4ed5869e90ddca (diff) |
make Beignet as intermedia layer of CMRT
CMRT is C for Media Runtime on Intel GPU, see https://github.com/01org/cmrt.
There is a request to make Beignet as intermedia layer of CMRT, in
other words, application programer write OpenCL APIs to execute the
CM kernel on GPU, the following shows the key code, and please refer
to the next patch of unit test for detail.
prog = clCreateProgramWithBinary("cm kernel");
clBuildProgram(prog);
kernel = clCreateKernel(prog, "kernel name");
image = clCreateImage();
clSetKernelArg(kernel, image);
clEnqueueNDRangeKernel(kernel);
Inside Beignet, once cm kernel is invoked, the following relative APIs
will be directly passed to CMRT library (libcmrt.so) which is loaded
via dlopen only when necessary. Since we use this simple method to
keep the code clean, OpenCL spec is not strictly followed, and cl_event
is not supported for this case.
v2: add comments about the cm queue in fuction cmrt_enqueue
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src/cl_device_id.h')
-rw-r--r-- | src/cl_device_id.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/cl_device_id.h b/src/cl_device_id.h index ea1030de..b01a6fb4 100644 --- a/src/cl_device_id.h +++ b/src/cl_device_id.h @@ -121,6 +121,9 @@ struct _cl_device_id { uint32_t atomic_test_result; uint32_t image_pitch_alignment; uint32_t image_base_address_alignment; + + //inited as NULL, created only when cmrt kernel is used + void* cmrt_device; //realtype: CmDevice* }; /* Get a device from the given platform */ |