Skip to content

Instantly share code, notes, and snippets.

@remexre
Last active September 19, 2016 05:32
Show Gist options
  • Save remexre/d7716a86edd84811f8cc4a801173be15 to your computer and use it in GitHub Desktop.
Save remexre/d7716a86edd84811f8cc4a801173be15 to your computer and use it in GitHub Desktop.
extern crate ocl;
use ocl::*;
macro_rules! test {
($obj: expr, $func: ident) => {
println!(concat!("\t", stringify!($obj), ".", stringify!($func), "(): {:?}"),
$obj.$func().chars().last() == Some('\0'));
};
($prefix: expr, $obj: expr, $func: ident) => {
print!("{}", $prefix);
test!($obj, $func);
}
}
fn main() {
println!("Has #48:");
for platform in Platform::list() {
test!(platform, name);
test!(platform, profile);
test!(platform, version);
test!(platform, vendor);
test!(platform, extensions);
for device in Device::list_all(&platform) {
println!("");
test!(device, name);
test!(device, vendor);
test!(device, to_string);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment