18 #if defined(ENABLE_CUDA) || defined(ENABLE_SYCL) 34 #if defined(ENABLE_CUDA) || defined(ENABLE_SYCL) 54 for (
int iw = 0; iw < nd; ++iw)
69 auto device_ptr2 = matrix_view2.device_data();
70 auto device_ptr3 = matrix_view3.device_data();
72 CHECK(device_ptr !=
nullptr);
73 CHECK(device_ptr2 !=
nullptr);
74 CHECK(device_ptr3 !=
nullptr);
76 std::ptrdiff_t distance_host = matrix_view.data() - vcsoa.
data();
77 std::ptrdiff_t distance_device = matrix_view.device_data() - vcsoa.
device_data();
78 CHECK(distance_host == distance_device);
80 distance_host = matrix_view2.data() - vcsoa.
data();
81 distance_device = matrix_view2.device_data() - vcsoa.
device_data();
82 CHECK(distance_host == distance_device);
84 distance_host = matrix_view3.data() - vcsoa.
data();
85 distance_device = matrix_view3.device_data() - vcsoa.
device_data();
86 CHECK(distance_host == distance_device);
97 matrix_view2(0, 0) = 0.0;
98 matrix_view2(1, 0) = 1.0;
100 matrix_view2.updateTo();
102 matrix_view(0, 1) = 3.0;
103 matrix_view.updateTo(1, 1);
104 matrix_view.updateFrom();
105 CHECK(matrix_view(0, 0) == 0.0);
106 CHECK(matrix_view(0, 1) == 3.0);
107 CHECK(matrix_view(1, 0) == 1.0);
114 TEST_CASE(
"OhmmsMatrix_VectorSoaContainer_View",
"[Integration][Allocators]")
116 testDualAllocator<OffloadPinnedAllocator<double>>();
117 testDualAllocator<OffloadPinnedAllocator<std::complex<double>>>();
118 #if defined(ENABLE_CUDA) || defined(ENABLE_SYCL) 119 testDualAllocator<VendorDualPinnedAllocator<double>>();
120 testDualAllocator<VendorDualPinnedAllocator<std::complex<double>>>();
helper functions for EinsplineSetBuilder
TEST_CASE("complex_helper", "[type_traits]")
Soa Container for D-dim vectors.
T * device_data()
return the base, device
void copyDeviceDataByIndex(unsigned to, unsigned from)
CHECKED_ELSE(check_matrix_result.result)
SoA adaptor class for Vector<TinyVector<T,D> >
void resize(size_type n, size_type m)
Resize the container.
void resize(const std::array< SIZET, D > &dims)
Resize the container.
void makeRngSpdMatrix(testing::RandomForTest< RngValueType< T >> &rng, Matrix< T > &mat_spd)
These allocators are to make code that should be generic with the respect to accelerator code flavor ...
OMPallocator is an allocator with fused device and dualspace allocator functionality.
T * data()
return the base
sycl::event copy_n(sycl::queue &aq, const T1 *restrict VA, size_t array_size, T2 *restrict VC, const std::vector< sycl::event > &events)
CheckMatrixResult checkMatrix(M1 &a_mat, M2 &b_mat, const bool check_all=false, std::optional< const double > eps=std::nullopt)
This function checks equality a_mat and b_mat elements M1, M2 need to have their element type declare...
CHECK(log_values[0]==ComplexApprox(std::complex< double >{ 5.603777579195571, -6.1586603331188225 }))
void resize(size_type n)
resize myData
A D-dimensional Array class based on PETE.
QMCTraits::FullPrecRealType value_type
Functor to provide scope for rng when making SpdMatrix for testing.