Skip to content

[BUG] Build failure with MATX_BUILD_32_BIT=ON #1117

@dagardner-nv

Description

@dagardner-nv

Describe the Bug
MatX fails to build when MATX_BUILD_32_BIT=ON with the following error:

[ 18%] Linking CXX executable test_00_tensor_VizTests
/workspace/test/00_misc/AllocatorTests.cu(381): error: more than one instance of overloaded function "make_tensor" matches the argument list:
            function template "auto matx::make_tensor<T,RANK,Allocator>(const matx::index_t (&)[RANK], Allocator &&)" (declared at line 417 of /workspace/include/matx/core/make_tensor.h)
            function template "auto matx::make_tensor(T *, ShapeType &&, bool)" (declared at line 312 of /workspace/include/matx/core/make_tensor.h)
            argument types are: (matx::index_t [1], TrackedAllocator)
          auto tensor3 = make_tensor<int>(shape1d, alloc);
                         ^
/workspace/include/matx/core/make_tensor.h(51): note #3326-D: function template "matx::make_tensor<T,RANK>(const matx::index_t (&)[RANK], matx::matxMemorySpace_t, cudaStream_t)" does not match because argument #2 does not match parameter
  auto make_tensor( const index_t (&shape)[RANK],
       ^
/workspace/include/matx/core/make_tensor.h(70): note #3326-D: function template "matx::make_tensor(matx::Storage<T>, ShapeType &&)" does not match because argument #1 does not match parameter
  auto make_tensor(Storage<T> storage, ShapeType &&shape) {
       ^
/workspace/include/matx/core/make_tensor.h(87): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, const matx::index_t (&)[<expression>], matx::matxMemorySpace_t, cudaStream_t)" failed
  void make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(133): note #3326-D: function template "matx::make_tensor<T,ShapeType,<unnamed>>(ShapeType &&, matx::matxMemorySpace_t, cudaStream_t)" does not match because argument #2 does not match parameter
  auto make_tensor( ShapeType &&shape,
       ^
/workspace/include/matx/core/make_tensor.h(163): note #3326-D: function template "matx::make_tensor(TensorType &, ShapeType &&, matx::matxMemorySpace_t, cudaStream_t)" does not match because argument #1 does not match parameter
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(212): note #3326-D: function template "matx::make_tensor<T>(std::initializer_list<matx::detail::no_size_t>, matx::matxMemorySpace_t, cudaStream_t)" does not match because argument #1 does not match parameter
  auto make_tensor( [[maybe_unused]] const std::initializer_list<detail::no_size_t> t,
       ^
/workspace/include/matx/core/make_tensor.h(230): note #3326-D: function template "matx::make_tensor(TensorType &, matx::matxMemorySpace_t, cudaStream_t)" does not match because argument #1 does not match parameter
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(267): note #3327-D: candidate function template "matx::make_tensor(T *, const matx::index_t (&)[RANK], bool)" failed deduction
  auto make_tensor( T *data,
       ^
/workspace/include/matx/core/make_tensor.h(290): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, TensorType::value_type *, const matx::index_t (&)[<expression>])" failed
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(337): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, TensorType::value_type *, TensorType::shape_container &&)" failed
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(356): note #3326-D: function template "matx::make_tensor(T *, std::initializer_list<matx::detail::no_size_t>, bool)" does not match because argument #2 does not match parameter
  auto make_tensor( T *ptr,
       ^
/workspace/include/matx/core/make_tensor.h(374): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, TensorType::value_type *)" failed
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(438): note #3327-D: candidate function template "matx::make_tensor<T,ShapeType,Allocator,<unnamed>>(ShapeType &&, Allocator &&)" failed deduction
  auto make_tensor( ShapeType &&shape,
       ^
/workspace/include/matx/core/make_tensor.h(460): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, const matx::index_t (&)[<expression>], Allocator &&)" failed
  void make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(482): note #3322-D: number of parameters of function template "matx::make_tensor(TensorType &, ShapeType &&, Allocator &&)" does not match the call
  void make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(504): note #3327-D: candidate function template "matx::make_tensor(T *, D &&, bool)" failed deduction
  auto make_tensor( T* const data,
       ^
/workspace/include/matx/core/make_tensor.h(527): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, TensorType::value_type *, TensorType::desc_type &&)" failed
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(546): note #3326-D: function template "matx::make_tensor<T,D,<unnamed>>(D &&, matx::matxMemorySpace_t, cudaStream_t)" does not match because argument #2 does not match parameter
  auto make_tensor( D &&desc,
       ^
/workspace/include/matx/core/make_tensor.h(568): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &&, TensorType::desc_type &&, matx::matxMemorySpace_t, cudaStream_t)" failed
  auto make_tensor( TensorType &&tensor,
       ^
/workspace/include/matx/core/make_tensor.h(592): note #3322-D: number of parameters of function template "matx::make_tensor(T *, const matx::index_t (&)[RANK], const matx::index_t (&)[RANK], bool)" does not match the call
  auto make_tensor( T *const data,
       ^
/workspace/include/matx/core/make_tensor.h(618): note #3323-D: substituting explicit template arguments "<int>" for function template "matx::make_tensor(TensorType &, TensorType::value_type *, const matx::index_t (&)[<expression>], const matx::index_t (&)[<expression>])" failed
  auto make_tensor( TensorType &tensor,
       ^
/workspace/include/matx/core/make_tensor.h(644): note #3326-D: function template "matx::make_tensor(TensorType &, DLManagedTensor)" does not match because argument #1 does not match parameter
  auto make_tensor( TensorType &tensor,
       ^

1 error detected in the compilation of "/workspace/test/00_misc/AllocatorTests.cu".
gmake[2]: *** [test/CMakeFiles/test_00_misc_AllocatorTests.dir/build.make:92: test/CMakeFiles/test_00_misc_AllocatorTests.dir/00_misc/AllocatorTests.cu.o] Error 255
gmake[1]: *** [CMakeFiles/Makefile2:1323: test/CMakeFiles/test_00_misc_AllocatorTests.dir/all] Error 2

To Reproduce
Works without MATX_BUILD_32_BIT=ON

git checkout tags/v0.9.4
rm -rf build
mkdir build
cmake -B build -DMATX_BUILD_TESTS=ON -DMATX_BUILD_BENCHMARKS=OFF -DMATX_BUILD_EXAMPLES=OFF -DMATX_BUILD_DOCS=OFF -DCMAKE_CUDA_ARCHITECTURES="86" -DMATX_BUILD_32_BIT=ON .

cmake --build build --parallel 32
# 

System Details (please complete the following information):

  • OS: Debian Linux 12.13
  • CUDA version: I've reproduced this with both 12.8 and 13.0
  • g++ version: I've reproduced this with both 12.1.0 and 13.3.0

Additional Context
We use 32 bit builds since many other Nvidia libraries default to 32bit (for us namely cudf).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions