Skip to content

arrayfire::set_rows fails on bool array? [BUG] #295

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
BA8F0D39 opened this issue May 7, 2021 · 2 comments · Fixed by #296
Closed

arrayfire::set_rows fails on bool array? [BUG] #295

BA8F0D39 opened this issue May 7, 2021 · 2 comments · Fixed by #296
Assignees
Labels
Milestone

Comments

@BA8F0D39
Copy link
Contributor

BA8F0D39 commented May 7, 2021

Description


	let v0: Vec<bool>  = vec![true, true, true, true, true, true];
	let mut a0 = arrayfire::Array::new(&v0, arrayfire::Dim4::new(&[v0.len() as u64, 1, 1, 1]));

	arrayfire::print_gen("a0".to_string(), &a0, Some(6));

	let v1: Vec<bool>  = vec![false, false];
	let mut a1 = arrayfire::Array::new(&v1, arrayfire::Dim4::new(&[v1.len() as u64, 1, 1, 1]));

	arrayfire::set_rows(&mut a0, &a1, 2, 3);

	arrayfire::print_gen("a0".to_string(), &a0, Some(6));

Info String:
ArrayFire v3.8.0 (CUDA, 64-bit Linux, build d99887ae)
Platform: CUDA Runtime 11.1, Driver: 465.19.01
[0] NVIDIA GeForce RTX 3090, 24267 MB, CUDA Compute 8.6
Arrayfire version: (3, 8, 0)
Name: NVIDIA_GeForce_RTX_3090
Platform: CUDA
Toolkit: v11.1
Compute: 8.6
Revision: d99887ae
a0
[6 1 1 1]
1
1
1
1
1
1

thread 'main' panicked at 'Error message: Size is incorrect
Last error: In function af_err af_assign_seq(void**, af_array, unsigned int, const af_seq*, af_array)
In file src/api/c/assign.cpp:184
Invalid dimension for argument 0
Expected: (outDims.ndims() >= (dim_t)ndims)
0# af_assign_seq in /lib/libafcuda.so.3
1# af_assign_seq in /lib/libaf.so.3

@BA8F0D39 BA8F0D39 added the Bug label May 7, 2021
@9prady9 9prady9 self-assigned this May 8, 2021
@9prady9 9prady9 added this to the 3.8.1 milestone May 8, 2021
@9prady9
Copy link
Member

9prady9 commented May 8, 2021

@BA8F0D39 I found the problem, it is in the wrapper call. Will send in a fix soon.

@9prady9
Copy link
Member

9prady9 commented May 8, 2021

@BA8F0D39 As a temporary work around you can do the following

        //set_rows(&mut a0, &a1, 2, 3);
        eval!( a0[2:3:1] = a1 );

I recommend using the macros eval and view to handle indexing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants