1 /* 2 * cl_intel_context.h - CL intel context 3 * 4 * Copyright (c) 2015 Intel Corporation 5 * 6 * Licensed under the Apache License, Version 2.0 (the "License"); 7 * you may not use this file except in compliance with the License. 8 * You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, software 13 * distributed under the License is distributed on an "AS IS" BASIS, 14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 * See the License for the specific language governing permissions and 16 * limitations under the License. 17 * 18 * Author: Wind Yuan <feng.yuan@intel.com> 19 */ 20 21 #ifndef XCAM_CL_INTEL_CONTEXT_H 22 #define XCAM_CL_INTEL_CONTEXT_H 23 24 #include <CL/cl_intel.h> 25 #include <ocl/cl_context.h> 26 27 namespace XCam { 28 29 class CLIntelContext 30 : public CLContext 31 { 32 friend class CLMemory; 33 friend class CLDevice; 34 friend class CLVaBuffer; 35 friend class CLVaImage; 36 37 public: ~CLIntelContext()38 ~CLIntelContext () {} 39 40 private: 41 explicit CLIntelContext (SmartPtr<CLDevice> &device); 42 43 cl_mem create_va_buffer (uint32_t bo_name); 44 cl_mem import_dma_buffer (const cl_import_buffer_info_intel &import_info); 45 cl_mem create_va_image (const cl_libva_image &image_info); 46 cl_mem import_dma_image (const cl_import_image_info_intel &image_info); 47 48 int32_t export_mem_fd (cl_mem mem_id); 49 50 private: 51 XCAM_DEAD_COPY (CLIntelContext); 52 }; 53 54 }; 55 56 #endif //XCAM_CL_CONTEXT_H 57