summaryrefslogtreecommitdiff
path: root/src/cl_api.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-13add extension intel_planar_yuv.Luo Xionghu1-1/+8
create a w* (3/2*h) size bo for the whole CL_NV12_INTEL format surface, and the y surface (format CL_R) share the first w * h part, uv surface (format CL_RG) share the left w * 1/2h part; set correct bo offset for uv surface per different platforms. v2: add extension define in libocl; fix error check. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2017-01-06Runtime: Fix a event bug.Yang Rong1-7/+21
SVM enqueues need to call cl_event_exec every time. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Junyan He <junyan.he@linux.intel.com>
2016-12-30Runtime: fix a profiling fail.Yang Rong1-15/+3
cl_event_exec it the uniformal entry for all event command execution, call cl_enqueue_handle may miss time stamp record. Replace all cl_enqueue_handle to cl_event_exec. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
2016-12-29GEB/Runtime: eliminate release build warnings.Yang Rong1-0/+2
Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
2016-12-28Add profiling feature based on new event implementation.Junyan He1-51/+0
TODO: In opencl 2.0, a new profiling item called CL_PROFILING_COMMAND_COMPLETE is imported. It means that we need to record the time stamp of all the child events created by the "Kernel enqueing kernels" feature finish. This should be done after the "Kernel enqueing kernels" feature enabled. V2: Update event time stamp before inserting to queue thread, avoid MT issue. V3: Fixup overflow problem. V4: Fixup overflow to 0xfffffffffffffffff problem. Just take ownership and release event lock when call the update timestamp function. The update timestamp function may have block system call can should not hold the lock to call it. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-19Move clCreateCommandQueueWithProperties API to command_queue file.Junyan He1-79/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-19Move Device related APIs to new fileJunyan He1-82/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Refine clSetMemObjectDestructorCallback API.Yang Rong1-26/+1
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16refine clCreateCommandQueue and clRetainCommandQueue.Junyan He1-38/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Refine retain/release sampler APIJunyan He1-20/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Refine clCreateSampler API.Junyan He1-18/+1
Also add some parameters check to this API. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Refine clRetain/Release MemObjectJunyan He1-20/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Add multi devices support in context.Junyan He1-12/+17
In future there may be more than one device on the platform, we need to consider multi devices within one context. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Refine create context APIs.Junyan He1-92/+0
Add multi-device logic, make it more readable and move it to new file. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Modify clGetImageInfo using cl_get_info_helper.Junyan He1-14/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-16Modify clGetMemObjectInfo using cl_get_info_helper.Junyan He1-19/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify program Info using cl_get_info_helper.Junyan He1-127/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetSamplerInfo using cl_get_info_helper.Junyan He1-29/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetDeviceInfo using cl_get_info_helper.Junyan He1-14/+0
V2: Delete some useless macro. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetContextInfo using cl_get_info_helper.Junyan He1-33/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetCommandQueueInfo using cl_get_info_helper.Junyan He1-29/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetKernelInfo using cl_get_info_helper.Junyan He1-35/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetPlatformInfo using cl_get_info_helper.Junyan He1-18/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-12-15Modify clGetEventInfo using cl_get_info_helper.Junyan He1-32/+0
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08Runtime: Add support for queue size and fix error handlingPan Xiuli1-7/+17
V2: Remove check for device queue and add device queue flag. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08runtime: handle PROGRAM_BUILD_GLOBAL_VARIABLE_TOTAL_SIZERuiling Song1-0/+5
Signed-off-by: Ruiling Song <ruiling.song@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
2016-11-08Runtime: Refine clGetSupportedImageFormats to support CL_MEM_FLAGSPan Xiuli1-0/+1
sRGB writes are not supported now, and we should not return them if any write was set as CL_MEM_FLAGS. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08Runtime: Add support for sRGBPan Xiuli1-1/+1
CL_sRGBA with CL_UNNORM_INT8 is the minimum request for OpenCL2.0 and CL_sBGRA is also support by hardware. None of the sRGB surface type suport hardware write. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08Runtime: Add pipe related APIsPan Xiuli1-0/+70
Add clCreatePipe and clGetPipeInfo Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08Runtime: Add clCreateSamplerWithPropertiesPan Xiuli1-0/+63
Add api clCreateSamplerWithProperties Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08OCL20: Implement clSetKernelExecInfo apiYang Rong1-2/+29
The extra exec info need reloc, otherwize gpu can't read/write. And it don't need set to curbe. So reloc it to unused binding table. Signed-off-by: Yang Rong <rong.r.yang at intel.com> Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Pan Xiuli <xiuli.pan@intel.com>
2016-11-08Runtime: Add API clCreateCommandQueueWithPropertiesLuo Xionghu1-0/+70
Contributor: Luo Xionghu <xionghu.luo at intel.com> Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-11-08OCL20: add svm enqueue apis and svm's sub buffer support.Yang Rong1-0/+278
Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2016-11-08OCL20: Add svm support.Yang Rong1-0/+87
Enable CL_DEVICE_SVM_COARSE_GRAIN_BUFFER svm support, use userptr and softpin to implement it. Use userptr to share the page between cpu and gpu, and softpin to unify the cpu and gpu's address. Now it works on i386 system. x86_64 depends on backend support. This patch base on DRM library and DRM kernel driver's softpin patch: http://lists.freedesktop.org/archives/intel-gfx/2015-September/075446.html. Signed-off-by: Yang Rong <rong.r.yang@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
2016-10-10Fix a bug for event error status.Junyan He1-2/+3
V2: Move the event list status check to clWaitForEvents API. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-28Modify all event related functions using new event handle.Junyan He1-1884/+4
Rewrite the cl_event, and modify all the event functions using this new event manner. Event will co-operate with command queue's thread together. v2: Fix a logic problem in event create failed. V3: Set enqueue default to do nothing, handle some enqueue has nothing to do. Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply base object to cl_accelerator_intelJunyan He1-1/+2
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply base_object to cl_kernelJunyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply base object to cl_command_queue.Junyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply base object to cl_contextJunyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply base object to cl_eventJunyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply base object ot cl_sampler.Junyan He1-1/+2
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-09-02Runtime: Apply CL base object to program.Junyan He1-1/+1
Signed-off-by: Junyan He <junyan.he@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-08-31avoid too many messages when the driver could not find good values for ↵Guo Yejun1-1/+10
local_size Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-07-15Runtime: Add subgroup extension API in clGetExtensionFunctionAddressPan Xiuli1-0/+1
Add clGetKernelSubGroupInfoKHR in the clGetExtensionFunctionAddress Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-06-13Runtime: Add API clGetKernelSubGroupInfoKHR for subgroup extensionPan Xiuli1-0/+20
Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2016-04-29only release cmrt device when it is already createdGuo Yejun1-1/+2
this patch fixed the issue at https://bugs.freedesktop.org/show_bug.cgi?id=95136 Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-23output warning message if do not find a good local_work_sizeGuo Yejun1-0/+4
If the user provides local_work_size as NULL in clEnqueueNDRangeKernel, and we could not find a good value inside driver, output a warning message with macro DEBUGP, and also refine the macro. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-09fix gcc build error.Luo Xionghu1-1/+1
this link fail appears on gcc 5.2.1. Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
2015-12-09runtime: add missing supported format image_1d_buffer.Luo Xionghu1-0/+1
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>