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

Method BufferD3D10

include/CL/opencl.hpp:4330–4366  ·  view source on GitHub ↗

! \brief Constructs a BufferD3D10, in a specified context, from a * given ID3D10Buffer. * * Wraps clCreateFromD3D10BufferKHR(). */

Source from the content-addressed store, hash-verified

4328 * Wraps clCreateFromD3D10BufferKHR().
4329 */
4330 BufferD3D10(
4331 const Context& context,
4332 cl_mem_flags flags,
4333 ID3D10Buffer* bufobj,
4334 cl_int * err = nullptr) : pfn_clCreateFromD3D10BufferKHR(nullptr)
4335 {
4336 typedef CL_API_ENTRY cl_mem (CL_API_CALL *PFN_clCreateFromD3D10BufferKHR)(
4337 cl_context context, cl_mem_flags flags, ID3D10Buffer* buffer,
4338 cl_int* errcode_ret);
4339 PFN_clCreateFromD3D10BufferKHR pfn_clCreateFromD3D10BufferKHR;
4340#if CL_HPP_TARGET_OPENCL_VERSION >= 120
4341 vector<cl_context_properties> props = context.getInfo<CL_CONTEXT_PROPERTIES>();
4342 cl_platform platform = nullptr;
4343 for( int i = 0; i < props.size(); ++i ) {
4344 if( props[i] == CL_CONTEXT_PLATFORM ) {
4345 platform = props[i+1];
4346 }
4347 }
4348 CL_HPP_INIT_CL_EXT_FCN_PTR_PLATFORM_(platform, clCreateFromD3D10BufferKHR);
4349#endif
4350#if CL_HPP_MINIMUM_OPENCL_VERSION < 120
4351 CL_HPP_INIT_CL_EXT_FCN_PTR_(clCreateFromD3D10BufferKHR);
4352#endif
4353
4354 cl_int error;
4355 object_ = pfn_clCreateFromD3D10BufferKHR(
4356 context(),
4357 flags,
4358 bufobj,
4359 &error);
4360
4361 // TODO: This should really have a D3D10 rerror code!
4362 detail::errHandler(error, __CREATE_GL_BUFFER_ERR);
4363 if (err != nullptr) {
4364 *err = error;
4365 }
4366 }
4367
4368 //! \brief Default constructor - initializes to nullptr.
4369 BufferD3D10() : Buffer() { }

Callers

nothing calls this directly

Calls 2

errHandlerFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected