5 #ifndef OMEGA_H_ARRAY_DEFAULT_HPP
6 #define OMEGA_H_ARRAY_DEFAULT_HPP
11 Write<T>::Write() : shared_alloc_() {}
14 LO Write<T>::size() const OMEGA_H_NOEXCEPT {
15 #ifdef OMEGA_H_CHECK_BOUNDS
16 OMEGA_H_CHECK(exists());
18 return static_cast<LO
>(shared_alloc_.size() /
sizeof(T));
22 OMEGA_H_DEVICE T& Write<T>::operator[](LO i)
const OMEGA_H_NOEXCEPT {
23 #ifdef OMEGA_H_CHECK_BOUNDS
24 OMEGA_H_CHECK_OP(0, <=, i);
25 OMEGA_H_CHECK_OP(i, <, size());
31 OMEGA_H_INLINE T* Write<T>::data() const noexcept {
32 return static_cast<T*
>(shared_alloc_.data());
36 OMEGA_H_INLINE
long Write<T>::use_count()
const {
return shared_alloc_.alloc->use_count; }
39 OMEGA_H_INLINE
bool Write<T>::exists() const noexcept {
40 return shared_alloc_.data() !=
nullptr;
44 inline T
const& HostRead<T>::operator[](LO i)
const OMEGA_H_NOEXCEPT {
45 #ifdef OMEGA_H_CHECK_BOUNDS
46 OMEGA_H_CHECK_OP(0, <=, i);
47 OMEGA_H_CHECK_OP(i, <, size());
49 #ifdef KOKKOS_ENABLE_CUDA
57 inline T& HostWrite<T>::operator[](LO i)
const OMEGA_H_NOEXCEPT {
58 #ifdef OMEGA_H_CHECK_BOUNDS
59 OMEGA_H_CHECK_OP(0, <=, i);
60 OMEGA_H_CHECK_OP(i, <, size());
62 #ifdef KOKKOS_ENABLE_CUDA
Definition: amr_mpi_test.cpp:6