From 91e1d3d220e1945d9d6321f2442294cc427440a0 Mon Sep 17 00:00:00 2001 From: Joseph Schuchart Date: Thu, 7 Nov 2024 21:54:18 -0500 Subject: [PATCH] POTRF: Fix allocator type when TiledArray is not available Signed-off-by: Joseph Schuchart --- examples/matrixtile.h | 8 +++++--- examples/potrf/potrf.h | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/examples/matrixtile.h b/examples/matrixtile.h index a759b1c3c..2d1e1f30e 100644 --- a/examples/matrixtile.h +++ b/examples/matrixtile.h @@ -12,7 +12,8 @@ #include #if defined(TILEDARRAY_HAS_DEVICE) -#define ALLOCATOR TiledArray::device_pinned_allocator +template +using default_allocator_t = TiledArray::device_pinned_allocator; inline void allocator_init(int argc, char **argv) { // initialize MADNESS so that TA allocators can be created @@ -26,7 +27,8 @@ inline void allocator_fini() { madness::finalize(); } #else // TILEDARRAY_HAS_DEVICE -#define ALLOCATOR std::allocator +template +using default_allocator_t = std::allocator; inline void allocator_init(int argc, char **argv) { } @@ -34,7 +36,7 @@ inline void allocator_fini() { } #endif // TILEDARRAY_HAS_DEVICE -template +template > class MatrixTile : public ttg::TTValue> { public: using metadata_t = typename std::tuple; diff --git a/examples/potrf/potrf.h b/examples/potrf/potrf.h index 894064b54..56d4382d8 100644 --- a/examples/potrf/potrf.h +++ b/examples/potrf/potrf.h @@ -11,7 +11,7 @@ #define ENABLE_DEVICE_KERNEL 1 #endif -#if defined(TTG_HAVE_CUDART) +#if defined(TTG_ENABLE_CUDA) #define ES ttg::ExecutionSpace::CUDA #include #elif defined(TTG_ENABLE_HIP) @@ -97,7 +97,7 @@ namespace potrf { ttg::Edge>& output_result) { using T = typename MatrixT::element_type; #if defined(ENABLE_DEVICE_KERNEL) - auto iallocator = std::make_shared>(); + auto iallocator = std::make_shared>(); //std::cout << "Creating CUDA POTRF task " << std::endl; auto f_dev = [=, iallocator = std::move(iallocator)] (const Key1& key, MatrixTile&& tile_kk,