1 /* 2 * Copyright (C) 2018-2021 Intel Corporation 3 * 4 * SPDX-License-Identifier: MIT 5 * 6 */ 7 8 #pragma once 9 #include "opencl/source/api/dispatch.h" 10 11 #include <cstdint> 12 13 struct ClDispatch { 14 SEntryPointsTable dispatch; ClDispatchClDispatch15 ClDispatch() : dispatch(globalDispatchTable) { 16 } 17 }; 18 19 struct _cl_accelerator_intel : public ClDispatch { 20 }; 21 22 struct _cl_command_queue : public ClDispatch { 23 }; 24 25 // device_queue is a type used internally 26 struct _device_queue : public _cl_command_queue { 27 }; 28 typedef _device_queue *device_queue; 29 30 struct _cl_context : public ClDispatch { 31 bool isSharedContext = false; 32 }; 33 34 struct _cl_device_id : public ClDispatch { 35 }; 36 37 struct _cl_event : public ClDispatch { 38 }; 39 40 struct _cl_kernel : public ClDispatch { 41 }; 42 43 struct _cl_mem : public ClDispatch { 44 }; 45 46 struct _cl_platform_id : public ClDispatch { 47 }; 48 49 struct _cl_program : public ClDispatch { 50 }; 51 52 struct _cl_sampler : public ClDispatch { 53 }; 54 55 template <typename Type> isValidObject(Type object)56inline bool isValidObject(Type object) { 57 return object && object->dispatch.icdDispatch == &icdGlobalDispatchTable; 58 } 59