| 51 | */ |
| 52 | |
| 53 | void 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 | |
| 82 | namespace arm_compute |
no test coverage detected