Skip to content
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

[simd] initialize ex::simd<type, scalar> through array will fail? #52

Closed
fepicture opened this issue Sep 8, 2022 · 2 comments
Closed
Assignees

Comments

@fepicture
Copy link

fepicture commented Sep 8, 2022

what happen

I am going to initialize the ex::simd through the pure array, but with simd_abi::scalar, it failed.
Do I miss something? or this is forbidden if we choose simd_abi::scalar

code paste:

void func() {
  char arr[1]{'a'};
  ex::simd<char, ex::simd_abi::scalar>(arr, ex::element_aligned_tag());
}
void func(){
  int arr_int[8]{1,2,3,4,5,6};
  ex::simd<int, ex::simd_abi::scalar>(arr_int, ex::element_aligned_tag());
}

reproduce

call the one of func in any test file, and under the github-ci.yml command to test this simple file.
https://github.com/plctlab/llvm-project/blob/libcxx-simd-dev/.gitlab-ci.yml#L16
like:

cd ~/llvm-project/build

build/bin/llvm-lit -a  build/runtimes/runtimes-x86_64-unknown-linux-gnu-bins/libcxx/test/std/experimental/simd/simd.reductions/hmax.pass.cpp

error log

/root/llvm-project/latest_build/build/include/c++/v1/experimental/simd:1764:12: error: no matching member function for call to '__load'
    _Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
    ~~~~~~~^~~~~~
/root/llvm-project/libcxx/test/std/experimental/simd/simd.reductions/hmax.pass.cpp:133:3: note: in instantiation of function template specialization 'std::experimental::simd<char, std::experimental::simd_abi::__scalar>::simd<char, std::experimental::element_aligned_tag, void>' requested here
  ex::simd<char, ex::simd_abi::scalar>(arr, ex::element_aligned_tag());
  ^
/root/llvm-project/latest_build/build/include/c++/v1/__simd/abi/scalar.h:21:16: note: candidate template ignored: could not match '_Up *' against 'std::experimental::simd<char, std::experimental::simd_abi::__scalar>::_Storage' (aka '__simd_storage<char, simd_abi::__scalar>')
  static _Simd __load(_Up* __mem, _Flags) noexcept {
               ^
1 error generated.

error: command failed with exit status: 1
@joy2myself joy2myself self-assigned this Sep 8, 2022
@joy2myself
Copy link
Collaborator

Fixed by commit ac6c9dc

@fepicture
Copy link
Author

Fixed by commit ac6c9dc

sorry, in my local it still reports some errors: (either char [1] or int [8])
my test code

 int arr_int[8]{1,2,3,4,5,6}; 
ex::simd<int, ex::simd_abi::scalar>(arr_int, ex::element_aligned_tag());

error log

In file included from /root/llvm-project/libcxx/test/std/experimental/simd/simd.reductions/hmax.pass.cpp:16:
/root/llvm-project/really_build/build/include/c++/v1/experimental/simd:1753:12: error: no matching member function for call to '__load'
    _Impl::__load(__s_, _Flags::template __apply<simd>(__mem));
    ~~~~~~~^~~~~~
/root/llvm-project/libcxx/test/std/experimental/simd/simd.reductions/hmax.pass.cpp:139:33: note: in instantiation of function template specialization 'std::experimental::simd<int, std::experimental::simd_abi::__scalar>::simd<int, std::experimental::element_aligned_tag, void>' requested here
   int arr_int[8]{1,2,3,4,5,6}; ex::simd<int, ex::simd_abi::scalar>(arr_int, ex::element_aligned_tag());
                                ^
/root/llvm-project/really_build/build/include/c++/v1/__simd/abi/scalar.h:21:15: note: candidate template ignored: couldn't infer template argument '_Flags'
  static void __load(_Simd& __s, const _Up* __mem) noexcept {
              ^
1 error generated.

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

No branches or pull requests

2 participants