()
| 929 | |
| 930 | #[test] |
| 931 | fn thread_move_array() { |
| 932 | // ANCHOR: move_array_to_thread |
| 933 | set_device(0); |
| 934 | info(); |
| 935 | let mut a = constant(1, dim4!(3, 3)); |
| 936 | |
| 937 | let handle = thread::spawn(move || { |
| 938 | //set_device to appropriate device id is required in each thread |
| 939 | set_device(0); |
| 940 | |
| 941 | println!("\nFrom thread {:?}", thread::current().id()); |
| 942 | |
| 943 | a += constant(2, dim4!(3, 3)); |
| 944 | print(&a); |
| 945 | }); |
| 946 | |
| 947 | //Need to join other threads as main thread holds arrayfire context |
| 948 | handle.join().unwrap(); |
| 949 | // ANCHOR_END: move_array_to_thread |
| 950 | } |
| 951 | |
| 952 | #[test] |
| 953 | fn thread_borrow_array() { |
nothing calls this directly
no test coverage detected