dense vector wrapper on host: size_t type
| 853 | |
| 854 | // dense vector wrapper on host: size_t type |
| 855 | class HostDnVecLongInt { |
| 856 | public: |
| 857 | int size; |
| 858 | size_t* vals; |
| 859 | |
| 860 | HostDnVecLongInt(): size(0), vals(nullptr) {} |
| 861 | HostDnVecLongInt(const int size): size(size), vals(nullptr) { |
| 862 | this->allocate(this->size); |
| 863 | } |
| 864 | |
| 865 | inline void allocate(const int size) { |
| 866 | if (this->vals == nullptr) { |
| 867 | this->size = size; |
| 868 | this->vals = (size_t*) malloc(sizeof(size_t) * size); |
| 869 | } |
| 870 | return; |
| 871 | } |
| 872 | |
| 873 | ~HostDnVecLongInt() { |
| 874 | if (this->vals != nullptr) { |
| 875 | free(this->vals); |
| 876 | this->vals = nullptr; |
| 877 | } |
| 878 | // std::cout << "HostDnVecLongInt destructor called!" << std::endl; |
| 879 | } |
| 880 | }; |
| 881 | |
| 882 | // dense vector wrapper on host: ptrdiff_t type |
| 883 | class HostDnVecPtrdiff_t { |
nothing calls this directly
no outgoing calls
no test coverage detected