HPXCL
 All Classes Functions
Public Member Functions
hpx::opencl::device Class Reference

An accelerator device. More...

#include <device.hpp>

List of all members.

Public Member Functions

 device (hpx::shared_future< hpx::naming::id_type > const &gid)
hpx::opencl::buffer create_buffer (cl_mem_flags flags, std::size_t size) const
 Creates an OpenCL buffer.
hpx::opencl::program create_program_with_source (const hpx::serialization::serialize_buffer< char > source) const
 Creates an OpenCL program object.
hpx::opencl::program create_program_with_binary (const hpx::serialization::serialize_buffer< char > binary) const
 Creates an OpenCL program object from a prebuilt binary.
template<cl_device_info Name>
hpx::future< typename
detail::device_info< Name >
::type > 
get_device_info () const
 Queries device infos.
template<cl_platform_info Name>
hpx::future< typename
detail::platform_info< Name >
::type > 
get_platform_info () const
 Queries platform infos.

Detailed Description

An accelerator device.

Examples:
hello_world.cpp.

Member Function Documentation

hpx::opencl::buffer hpx::opencl::device::create_buffer ( cl_mem_flags  flags,
std::size_t  size 
) const

Creates an OpenCL buffer.

Parameters:
flagsSets properties of the buffer.
Possible values are
  • CL_MEM_READ_WRITE
  • CL_MEM_WRITE_ONLY
  • CL_MEM_READ_ONLY
  • CL_MEM_HOST_WRITE_ONLY
  • CL_MEM_HOST_READ_ONLY
  • CL_MEM_HOST_NO_ACCESS
and combinations of them.
For further information, read the official OpenCL Reference.
sizeThe size of the buffer, in bytes.
Returns:
A new buffer object.
See also:
buffer
Examples:
hello_world.cpp.
hpx::opencl::program hpx::opencl::device::create_program_with_binary ( const hpx::serialization::serialize_buffer< char >  binary) const

Creates an OpenCL program object from a prebuilt binary.

One can create a prebuilt binary from a compiled hpx::opencl::program with program::get_binary()

Parameters:
binaryThe binary execution code for the program.
Returns:
A program object associated with the calling device.
hpx::opencl::program hpx::opencl::device::create_program_with_source ( const hpx::serialization::serialize_buffer< char >  source) const

Creates an OpenCL program object.

After creating a program object, one usually compiles the program an creates kernels from it.

One program can contain code for multiple kernels.

Parameters:
sourceThe source code string for the program.
Returns:
A program object associated with the calling device.
Examples:
hello_world.cpp.
template<cl_device_info Name>
hpx::future<typename detail::device_info<Name>::type> hpx::opencl::device::get_device_info ( ) const [inline]

Queries device infos.

The template argument defines the type of information. A complete list can be found on the official OpenCL Reference.

Returns:
The requested information.
template<cl_platform_info Name>
hpx::future<typename detail::platform_info<Name>::type> hpx::opencl::device::get_platform_info ( ) const [inline]

Queries platform infos.

The template argument defines the type of information. A complete list can be found on the official OpenCL Reference.

Returns:
The requested information.

The documentation for this class was generated from the following file:
 All Classes Functions