Skip to content
This repository has been archived by the owner on Nov 12, 2017. It is now read-only.

Commit

Permalink
Ignore CL_INVALID_VALUE for DeviceInfo.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0gent committed Feb 4, 2017
1 parent 2e0f796 commit e7666bc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,13 @@ pub fn get_device_info<D: ClDeviceIdPtr>(device: &D, request: DeviceInfo)
&mut result_size as *mut size_t,
) };

// Don't generate a full error report for `CL_INVALID_VALUE` it's always
// just an extension unsupported by the device (i.e.
// `CL_DEVICE_HALF_FP_CONFIG` on Intel):
if Status::from_i32(errcode).unwrap() == Status::CL_INVALID_VALUE {
return DeviceInfoResult::Error(Box::new(OclError::new("[UNAVAILABLE (CL_INVALID_VALUE)]")));
}

// try!(errcode_try("clGetDeviceInfo", "", errcode));
if let Err(err) = errcode_try("clGetDeviceInfo", "", errcode) {
return DeviceInfoResult::Error(Box::new(err));
Expand All @@ -372,7 +379,6 @@ pub fn get_device_info<D: ClDeviceIdPtr>(device: &D, request: DeviceInfo)
0 as *mut size_t,
) };


let result = errcode_try("clGetDeviceInfo", "", errcode).and(Ok(result));

match request {
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,6 @@ bitflags! {

// #[derive(PartialEq, Debug, FromPrimitive)]
enum_from_primitive! {
/// TODO: MOVE ME AND LEAVE CONSTS AS THEY WERE.
/// The status of an OpenCL API call. Used for returning success/error codes.
#[repr(C)]
#[derive(Debug, PartialEq, Clone)]
Expand Down

0 comments on commit e7666bc

Please sign in to comment.