MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / initialise_context_properties

Function initialise_context_properties

src/runtime/CL/CLHelpers.cpp:53–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 */
52
53void initialise_context_properties(const cl::Platform &platform,
54 const cl::Device &device,
55 std::array<cl_context_properties, 7> &prop)
56{
57 ARM_COMPUTE_UNUSED(device);
58#if defined(ARM_COMPUTE_ASSERTS_ENABLED)
59 // Query devices in the context for cl_arm_printf support
60 if (arm_compute::device_supports_extension(device, "cl_arm_printf"))
61 {
62 // Create a cl_context with a printf_callback and user specified buffer size.
63 std::array<cl_context_properties, 7> properties_printf = {
64 CL_CONTEXT_PLATFORM, reinterpret_cast<cl_context_properties>(platform()),
65 // Enable a printf callback function for this context.
66 CL_PRINTF_CALLBACK_ARM, reinterpret_cast<cl_context_properties>(printf_callback),
67 // Request a minimum printf buffer size of 4MB for devices in the
68 // context that support this extension.
69 CL_PRINTF_BUFFERSIZE_ARM, 0x1000, 0};
70 prop = properties_printf;
71 }
72 else
73#endif // defined(ARM_COMPUTE_ASSERTS_ENABLED)
74 {
75 std::array<cl_context_properties, 3> properties = {CL_CONTEXT_PLATFORM,
76 reinterpret_cast<cl_context_properties>(platform()), 0};
77 std::copy(properties.begin(), properties.end(), prop.begin());
78 };
79}
80} //namespace
81
82namespace arm_compute

Callers 1

Calls 4

copyFunction · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected