You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to get a feel for the matx api and usage and am running into compilation issues with static tensors. With the following code:
constexpr int N = 1'000;
auto t_samples = matx::make_static_tensor<cuda::std::complex<float>, N>();
auto real = t_samples.RealView();
I get the following compilation error:
/usr/local/include/matx/core/tensor.h(815): error: too many initializer values
Desc new_desc{this->desc_.Shape(), std::move(strides)};
^
detected during instantiation of "auto matx::tensor_t<T, RANK, Storage, Desc>::RealView() const noexcept [with T=cuda::std::__4::complex<float>, RANK=1, Storage=matx::basic_storage<matx::raw_pointer_buffer<cuda::std::__4::complex<float>, matx::matx_allocator<cuda::std::__4::complex<float>>>>, Desc=matx::static_tensor_desc_t<1000000000LL>, U=cuda::std::__4::complex<float>]" at line 154 of /root/src/sw/algo/unit_test/test.cu
If I comment out the call to RealView I get the error:
/usr/local/include/matx/core/tensor_desc.h(374): error: identifier "matx::static_tensor_desc_t<(long long)1000000000ll > ::shape_" is undefined in device code
Is there a reason I should not expect this to work using static tensors? The same code using make_tensor<cuda::std::complex<float>>({N}); compiles without issue.
NVCC compiler
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Aug_14_10:10:22_PDT_2024
Cuda compilation tools, release 12.6, V12.6.68
Build cuda_12.6.r12.6/compiler.34714021_0
Hi @deanljohnson , unfortunately static tensors are one of the sources where we've had lots of compatibility issues between different compilers and versions. We will look into this, but I would recommend not using static tensors yet until you get the functionality working. Static tensors exist for saving instructions to compute offsets, which can be very helpful for tensors with many dimensions. For roughly 3 dimensions and below it won't make much of a difference.
I'll avoid them for now. I don't imagine they will make too large of a difference for what I am doing anyways. This was just me trying to get a feel for matx in general.
I am trying to get a feel for the matx api and usage and am running into compilation issues with static tensors. With the following code:
I get the following compilation error:
If I comment out the call to
RealView
I get the error:Is there a reason I should not expect this to work using static tensors? The same code using
make_tensor<cuda::std::complex<float>>({N});
compiles without issue.NVCC compiler
MatX commit: 86b74bc (current master)
Host Compiler: gcc 11.4.1 20231218
The text was updated successfully, but these errors were encountered: