Beispiel #1
0
 /**
     \param platform The platform which all devices in this list should
                     be associated with.
     \param type     The type which all devices in this list should
                     belong to. By default, CL_DEVICE_TYPE_DEFAULT is
                     specified.
  */
 DeviceList(Platform platform, cl_device_type type = CL_DEVICE_TYPE_DEFAULT)
 {
     cl_uint num = 0;
     cl_int err = clGetDeviceIDs(platform.id(), type, 0, NULL, &num);
     if(num == 0) // check the number before error code
         return;
     CLPP_CHECK_ERROR(err);
     my_list.resize(num);
     err = clGetDeviceIDs(platform.id(), type, num, &my_list[0], NULL);
     CLPP_CHECK_ERROR(err);
 }
Beispiel #2
0
 /** 
     \param platform The specified platform.
     \param type     The type of devices to be used in the platform. By 
                     default, CL_DEVICE_TYPE_DEFAULT is used.
  */
 Context(Platform platform, cl_device_type type = CL_DEVICE_TYPE_DEFAULT)
     : my_devices(platform, type)
 {
     initByPlatform(platform.id(), type);
 }
Beispiel #3
0
/* ----------------------------------------------------------------------- */
void Context_Properties::
set_platform(Platform const& platform)
{
  this->set_platform_id(platform.id());
}