[HIP] add test for uses of std::array on device code#244
[HIP] add test for uses of std::array on device code#244jmmartinez merged 1 commit intollvm:mainfrom
Conversation
External/CUDA/array.cu
Outdated
| __global__ void kernel() { do_test(); } | ||
|
|
||
| int main() { | ||
| kernel<<<32, 32>>>(); |
There was a problem hiding this comment.
can std::array be parameter type of kernel or device functions?
can it be used as non-constexpr stack variable in kernel or device functions?
if so, can we have testcases for those?
There was a problem hiding this comment.
can std::array be parameter type of kernel or device functions?
It can be used as a parameter for device and kernel functions (which would trigger the copy-constructor). According to the c++ reference std::array is an aggregate in the the same way as a struct with an array inside; so the same rules should apply. For example, all the constructors are implicitly declared.
I'm not sure that adding the copy-constructor case here will improve the coverage of the test (we're testing the interaction with the standard C++ library, and there is no code to test since these behaviors are implicitly defined by clang). Passing an aggregate as an argument should be covered by the tests on clang's side.
I can add the test for std::array constructors here too if you think we really need them.
can it be used as non-constexpr stack variable in kernel or device functions?
This is already covered in the test. We check std::array both in a constexpr and non-constexpr context.
e9f5343 to
2731dd1
Compare
2731dd1 to
631eac0
Compare
|
I've moved the array test from CUDA to HIP since I have less control over CUDA buildbots. The hipify tests are already merged. |
|
Would you be ok to:
|
|
The commit appears to break CUDA tests: |
| list(APPEND CUDA_LOCAL_TESTS assert) | ||
| list(APPEND CUDA_LOCAL_TESTS axpy) | ||
| list(APPEND CUDA_LOCAL_TESTS algorithm) | ||
| list(APPEND CUDA_LOCAL_TESTS array) |
There was a problem hiding this comment.
There's no matching array.cu file committed under CUDA which makes cmake configuration fail.
First attempt at testing llvm/llvm-project#136133 .
Draft for the moment, I have to manually test this further.