23.05
|
CLCompileContext class. More...
#include <CLCompileContext.h>
Public Member Functions | |
CLCompileContext () | |
Constructor. More... | |
CLCompileContext (cl::Context context, const cl::Device &device) | |
Constructor. More... | |
cl::Context & | context () |
Accessor for the associated CL context. More... | |
void | set_context (cl::Context context) |
Sets the CL context used to create programs. More... | |
const cl::Device & | get_device () const |
Gets the CL device for which the programs are created. More... | |
void | set_device (cl::Device device) |
Sets the CL device for which the programs are created. More... | |
Kernel | create_kernel (const std::string &kernel_name, const std::string &program_name, const std::string &program_source, const std::string &kernel_path, const StringSet &build_options_set, bool is_binary) const |
Creates an OpenCL kernel. More... | |
void | clear_programs_cache () |
Clear the library's cache of binary programs. More... | |
const std::map< std::string, cl::Program > & | get_built_programs () const |
Access the cache of built OpenCL programs. More... | |
void | add_built_program (const std::string &built_program_name, const cl::Program &program) const |
Add a new built program to the cache. More... | |
bool | fp16_supported () const |
Returns true if FP16 is supported by the CL device. More... | |
cl_uint | get_num_compute_units () const |
Return the maximum number of compute units in the device. More... | |
size_t | max_local_workgroup_size (const cl::Kernel &kernel) const |
Find the maximum number of local work items in a workgroup can be supported for the kernel. More... | |
cl::NDRange | default_ndrange () const |
Return the default NDRange for the device. More... | |
std::string | get_device_version () const |
Return the device version. More... | |
bool | int64_base_atomics_supported () const |
Returns true if int64_base_atomics extension is supported by the CL device. More... | |
bool | is_wbsm_supported () const |
int32_t | get_ddk_version () const |
Return the DDK version. More... | |
GPUTarget | get_gpu_target () const |
Return the Gpu target of the associated device. More... | |
CLCompileContext class.
Definition at line 204 of file CLCompileContext.h.
CLCompileContext | ( | ) |
Constructor.
Definition at line 146 of file CLCompileContext.cpp.
CLCompileContext | ( | cl::Context | context, |
const cl::Device & | device | ||
) |
Constructor.
[in] | context | A CL context. |
[in] | device | A CL device. |
Definition at line 151 of file CLCompileContext.cpp.
References arm_compute::get_wbsm_support_info().
void add_built_program | ( | const std::string & | built_program_name, |
const cl::Program & | program | ||
) | const |
Add a new built program to the cache.
[in] | built_program_name | Name of the program |
[in] | program | Built program to add to the cache |
Definition at line 306 of file CLCompileContext.cpp.
Referenced by CLKernelLibrary::add_built_program().
void clear_programs_cache | ( | ) |
Clear the library's cache of binary programs.
Definition at line 311 of file CLCompileContext.cpp.
Referenced by CLKernelLibrary::clear_programs_cache().
cl::Context & context | ( | ) |
Accessor for the associated CL context.
Definition at line 322 of file CLCompileContext.cpp.
Referenced by CLKernelLibrary::context().
Kernel create_kernel | ( | const std::string & | kernel_name, |
const std::string & | program_name, | ||
const std::string & | program_source, | ||
const std::string & | kernel_path, | ||
const StringSet & | build_options_set, | ||
bool | is_binary | ||
) | const |
Creates an OpenCL kernel.
[in] | kernel_name | Kernel name. |
[in] | program_name | Program name. |
[in] | program_source | Program source. |
[in] | kernel_path | CL kernel path. |
[in] | build_options_set | Kernel build options as a set. |
[in] | is_binary | Flag to indicate if the program source is binary. |
Definition at line 159 of file CLCompileContext.cpp.
References ARM_COMPUTE_UNUSED, Program::build(), build_options, and CLDevice::cl_device().
Referenced by ClKernelRuntime::configure(), CLKernelLibrary::create_kernel(), arm_compute::create_kernel(), and arm_compute::test::validation::TEST_CASE().
cl::NDRange default_ndrange | ( | ) | const |
Return the default NDRange for the device.
Definition at line 338 of file CLCompileContext.cpp.
References CLDevice::cl_device(), arm_compute::get_target_from_device(), arm_compute::MIDGARD, arm_compute::T600, arm_compute::T700, and arm_compute::T800.
Referenced by CLKernelLibrary::default_ndrange().
bool fp16_supported | ( | ) | const |
Returns true if FP16 is supported by the CL device.
Definition at line 283 of file CLCompileContext.cpp.
References ARM_COMPUTE_UNUSED, and CLDevice::supported().
Referenced by CLKernelLibrary::fp16_supported().
const std::map< std::string, cl::Program > & get_built_programs | ( | ) | const |
Access the cache of built OpenCL programs.
Definition at line 317 of file CLCompileContext.cpp.
Referenced by CLKernelLibrary::get_built_programs(), and arm_compute::test::validation::TEST_CASE().
int32_t get_ddk_version | ( | ) | const |
Return the DDK version.
If the DDK version cannot be detected, return -1.
Definition at line 389 of file CLCompileContext.cpp.
References CLDevice::device_version(), and arm_compute::support::cpp11::stoi().
Referenced by ClTransposedConvolutionKernel::configure(), ClIndirectConv2dKernel::configure(), ClDirectConv2dKernel::configure(), and CLCompileContext::set_context().
const cl::Device & get_device | ( | ) | const |
Gets the CL device for which the programs are created.
Definition at line 327 of file CLCompileContext.cpp.
References CLDevice::cl_device().
Referenced by CLKernelLibrary::get_device().
std::string get_device_version | ( | ) | const |
Return the device version.
Definition at line 379 of file CLCompileContext.cpp.
References CLDevice::device_version().
Referenced by CLKernelLibrary::get_device_version().
GPUTarget get_gpu_target | ( | ) | const |
Return the Gpu target of the associated device.
Definition at line 402 of file CLCompileContext.cpp.
References CLDevice::target().
Referenced by GpuWorkloadContext::gpu_target().
cl_uint get_num_compute_units | ( | ) | const |
Return the maximum number of compute units in the device.
Definition at line 384 of file CLCompileContext.cpp.
References CLDevice::compute_units().
Referenced by CLKernelLibrary::get_num_compute_units().
bool int64_base_atomics_supported | ( | ) | const |
Returns true if int64_base_atomics extension is supported by the CL device.
Definition at line 358 of file CLCompileContext.cpp.
References CLDevice::supported().
Referenced by CLKernelLibrary::int64_base_atomics_supported().
bool is_wbsm_supported | ( | ) | const |
Definition at line 363 of file CLCompileContext.cpp.
Referenced by CLKernelLibrary::is_wbsm_supported().
size_t max_local_workgroup_size | ( | const cl::Kernel & | kernel | ) | const |
Find the maximum number of local work items in a workgroup can be supported for the kernel.
Definition at line 368 of file CLCompileContext.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_UNUSED, and CLDevice::cl_device().
Referenced by CLKernelLibrary::max_local_workgroup_size().
void set_context | ( | cl::Context | context | ) |
Sets the CL context used to create programs.
[in] | context | A CL context. |
Definition at line 218 of file CLCompileContext.cpp.
References ARM_COMPUTE_ERROR, build_options, arm_compute::get_arch_from_target(), CLCompileContext::get_ddk_version(), CLDevice::is_non_uniform_workgroup_supported(), arm_compute::MIDGARD, CLDevice::supported(), CLDevice::target(), arm_compute::support::cpp11::to_string(), type, and arm_compute::UNKNOWN.
Referenced by CLKernelLibrary::set_context().
void set_device | ( | cl::Device | device | ) |
Sets the CL device for which the programs are created.
[in] | device | A CL device. |
Definition at line 332 of file CLCompileContext.cpp.
References arm_compute::get_wbsm_support_info().
Referenced by CLKernelLibrary::set_device().