Skip to content

Commit 8d076a6

Browse files
committed
Fix opencl interop examples to use OpenCL backend always
1 parent 8df6b05 commit 8d076a6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

opencl-interop/examples/custom_kernel.rs

+4
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ use ocl_core::{ArgVal, Event};
77
use std::ffi::CString;
88

99
fn main() {
10+
// Set the arrayfire backend to use OpenCL first,
11+
// because CUDA is the automatically preferred if available
12+
af::set_backend(af::Backend::OPENCL);
13+
1014
af::info();
1115
let dims = af::dim4!(8);
1216
let af_buffer = af::constant(0f32, dims.clone());

opencl-interop/examples/ocl_af_app.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ use arrayfire as af;
55
use ocl_core::{ContextProperties, Event};
66

77
fn main() {
8-
// Set the arrayfire backend to use OopenCL first, because CUDA is the default
8+
// Set the arrayfire backend to use OpenCL first,
9+
// because CUDA is the automatically preferred if available
910
af::set_backend(af::Backend::OPENCL);
1011

1112
// Choose platform & device(s) to use. Create a context, queue,

0 commit comments

Comments
 (0)