QMCPACK
maptest< T > Struct Template Reference
+ Collaboration diagram for maptest< T >:

Public Member Functions

void set_value (int i, const T *restrict array, T *restrict data)
 
void run ()
 

Public Attributes

data [size]
 

Static Public Attributes

static const size_t size = 6
 

Detailed Description

template<typename T>
struct qmcplusplus::maptest< T >

Definition at line 24 of file test_class_member.cpp.

Member Function Documentation

◆ run()

void run ( )
inline

Definition at line 36 of file test_class_member.cpp.

References maptest< T >::data, maptest< T >::set_value(), and maptest< T >::size.

Referenced by qmcplusplus::TEST_CASE().

37  {
38  PRAGMA_OFFLOAD("omp target enter data map(alloc:data[0:6])")
39  T newdata[size] = {0, 1, 2, 3, 4, 5};
40  PRAGMA_OFFLOAD("omp target map(to:newdata[0:6]) map(from:data[0:6])")
41  {
42  PRAGMA_OFFLOAD("omp parallel for")
43  for (int i = 0; i < size; i++)
44  set_value(i, newdata, data);
45  }
46  PRAGMA_OFFLOAD("omp target exit data map(delete:data[0:6])")
47  std::cout << "data[5] = " << data[5] << std::endl;
48  }
for(int i=0;i< size_test;++i) CHECK(Approx(gauss_random_vals[offset_for_rs+i])
static const size_t size
void set_value(int i, const T *restrict array, T *restrict data)

◆ set_value()

void set_value ( int  i,
const T *restrict  array,
T *restrict  data 
)
inline

Definition at line 30 of file test_class_member.cpp.

References maptest< T >::data.

Referenced by maptest< T >::run().

31  {
32  data[i] = array[i];
33  }

Member Data Documentation

◆ data

T data[size]

Definition at line 27 of file test_class_member.cpp.

Referenced by maptest< T >::run(), and maptest< T >::set_value().

◆ size

const size_t size = 6
static

Definition at line 26 of file test_class_member.cpp.

Referenced by maptest< T >::run().


The documentation for this struct was generated from the following file: