Skip to content

Commit

Permalink
Bump TA to support ROCM allocators
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <schuchart@icl.utk.edu>
  • Loading branch information
devreal committed Sep 25, 2023
1 parent a423e87 commit a7fe69a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion cmake/modules/ExternalDependenciesVersions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ set(TTG_TRACKED_CEREAL_VERSION 1.3.0)
set(TTG_TRACKED_MADNESS_TAG 31d803325623de75371774feffb0270c796bea24)
set(TTG_TRACKED_PARSEC_TAG e59bed9d4934775792a58980cf5500bd41381bc4)
set(TTG_TRACKED_BTAS_TAG d73153ad9bc41a177e441ef04eceff7fab0c766d)
set(TTG_TRACKED_TILEDARRAY_TAG f6f5039b54ee5a1180106351cac05e0d33e14c62)
set(TTG_TRACKED_TILEDARRAY_TAG 055cf56681e5e55f4c7d415597540f6d65a31097)
11 changes: 5 additions & 6 deletions examples/spmm/spmm_cuda.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <btas/btas.h>
#include <btas/optimize/contract.h>
#include <btas/util/mohndle.h>
#include <TiledArray/cuda/allocators.h>
#include <TiledArray/device/allocators.h>
#include <ttg/device/cublas_helper.h>
#include <madness/world/parsec.h> // need to initialize MADNESS purely for the purposes of TA allocators
#else
Expand Down Expand Up @@ -52,8 +52,8 @@ using namespace ttg;
template <typename _T, class _Range, class _Storage>
struct DeviceTensor : public ttg::TTValue<DeviceTensor<_T, _Range, _Storage>>
, public btas::Tensor<_T, _Range, _Storage> {
using tensor_type = btas::Tensor<_T, _Range, _Storage>;
using ttvalue_type = ttg::TTValue<DeviceTensor<_T, _Range, _Storage>>;
using tensor_type = typename btas::Tensor<_T, _Range, _Storage>;
using ttvalue_type = typename ttg::TTValue<DeviceTensor<_T, _Range, _Storage>>;
ttg::buffer<_T> b; // does not own the host buffer

using value_type = typename tensor_type::value_type;
Expand Down Expand Up @@ -246,12 +246,11 @@ struct DeviceTensor : public ttg::TTValue<DeviceTensor<_T, _Range, _Storage>>

};

#if defined(TTG_HAVE_CUDA)
#if defined(TTG_HAVE_CUDA) || defined(TTG_HAVE_HIPBLAS)
using blk_t = DeviceTensor<double, btas::DEFAULT::range,
btas::mohndle<btas::varray<double, TiledArray::cuda_pinned_allocator<double>>,
btas::mohndle<btas::varray<double, TiledArray::device_pinned_allocator<double>>,
btas::Handle::shared_ptr>>;
#else
// TODO: no hip pinned allocator in TA?
using blk_t = DeviceTensor<double, btas::DEFAULT::range,
btas::mohndle<btas::varray<double>, btas::Handle::shared_ptr>>;
#endif
Expand Down

0 comments on commit a7fe69a

Please sign in to comment.