diff --git a/build.rs b/build.rs index c1fca518a..43f418495 100644 --- a/build.rs +++ b/build.rs @@ -281,7 +281,7 @@ fn run_cmake_command(conf: &Config, build_dir: &std::path::Path) { run( make_cmd .arg(format!("-j{}", conf.build_threads)) - .arg("install".to_string()), + .arg("install"), "make", ); } diff --git a/opencl-interop/src/lib.rs b/opencl-interop/src/lib.rs index b8676f09f..d841a3481 100644 --- a/opencl-interop/src/lib.rs +++ b/opencl-interop/src/lib.rs @@ -88,35 +88,27 @@ pub fn get_device_id() -> cl_device_id { } /// Set the cl_device_id as the active ArrayFire OpenCL device -pub fn set_device_id(dev_id: cl_device_id) { - unsafe { - let err_val = afcl_set_device_id(dev_id); - handle_error_general(AfError::from(err_val)); - } +pub unsafe fn set_device_id(dev_id: cl_device_id) { + let err_val = afcl_set_device_id(dev_id); + handle_error_general(AfError::from(err_val)); } /// Push user provided device, context and queue tuple to ArrayFire device mamanger -pub fn add_device_context(dev_id: cl_device_id, ctx: cl_context, queue: cl_command_queue) { - unsafe { - let err_val = afcl_add_device_context(dev_id, ctx, queue); - handle_error_general(AfError::from(err_val)); - } +pub unsafe fn add_device_context(dev_id: cl_device_id, ctx: cl_context, queue: cl_command_queue) { + let err_val = afcl_add_device_context(dev_id, ctx, queue); + handle_error_general(AfError::from(err_val)); } /// Set the device identified by device & context pair as the active device for ArrayFire -pub fn set_device_context(dev_id: cl_device_id, ctx: cl_context) { - unsafe { - let err_val = afcl_set_device_context(dev_id, ctx); - handle_error_general(AfError::from(err_val)); - } +pub unsafe fn set_device_context(dev_id: cl_device_id, ctx: cl_context) { + let err_val = afcl_set_device_context(dev_id, ctx); + handle_error_general(AfError::from(err_val)); } /// Remove the user provided device, context pair from ArrayFire device mamanger -pub fn delete_device_context(dev_id: cl_device_id, ctx: cl_context) { - unsafe { - let err_val = afcl_delete_device_context(dev_id, ctx); - handle_error_general(AfError::from(err_val)); - } +pub unsafe fn delete_device_context(dev_id: cl_device_id, ctx: cl_context) { + let err_val = afcl_delete_device_context(dev_id, ctx); + handle_error_general(AfError::from(err_val)); } ///// Fetch Active ArrayFire device's type i.e. CPU/GPU/Accelerator etc. diff --git a/src/ml/mod.rs b/src/ml/mod.rs index e448e023f..baa2688a0 100644 --- a/src/ml/mod.rs +++ b/src/ml/mod.rs @@ -76,11 +76,11 @@ where &mut temp as *mut af_array, signal.get(), filter.get(), - 4, + 2, strides.get().as_ptr() as *const dim_t, - 4, + 2, padding.get().as_ptr() as *const dim_t, - 4, + 2, dilation.get().as_ptr() as *const dim_t, ); HANDLE_ERROR(AfError::from(err_val)); @@ -126,11 +126,11 @@ where original_signal.get(), original_filter.get(), convolved_output.get(), - 4, + 2, strides.get().as_ptr() as *const dim_t, - 4, + 2, padding.get().as_ptr() as *const dim_t, - 4, + 2, dilation.get().as_ptr() as *const dim_t, grad_type as c_uint, );