! \brief Constructs a Buffer in a specified context. * * Wraps clCreateBuffer(). * * \param host_ptr Storage to be used if the CL_MEM_USE_HOST_PTR flag was * specified. Note alignment & exclusivity requirements. */
| 4098 | * specified. Note alignment & exclusivity requirements. |
| 4099 | */ |
| 4100 | Buffer( |
| 4101 | const Context& context, |
| 4102 | cl_mem_flags flags, |
| 4103 | size_type size, |
| 4104 | void* host_ptr = nullptr, |
| 4105 | cl_int* err = nullptr) |
| 4106 | { |
| 4107 | cl_int error; |
| 4108 | object_ = ::clCreateBuffer(context(), flags, size, host_ptr, &error); |
| 4109 | |
| 4110 | detail::errHandler(error, __CREATE_BUFFER_ERR); |
| 4111 | if (err != nullptr) { |
| 4112 | *err = error; |
| 4113 | } |
| 4114 | } |
| 4115 | |
| 4116 | #if CL_HPP_TARGET_OPENCL_VERSION >= 300 |
| 4117 | /*! \brief Constructs a Buffer in a specified context and with specified properties. |
nothing calls this directly
no test coverage detected