dense vector wrapper on host: int type
| 825 | |
| 826 | // dense vector wrapper on host: int type |
| 827 | class HostDnVecInt { |
| 828 | public: |
| 829 | int size; |
| 830 | int* vals; |
| 831 | |
| 832 | HostDnVecInt(): size(0), vals(nullptr) {} |
| 833 | HostDnVecInt(const int size): size(size), vals(nullptr) { |
| 834 | this->allocate(this->size); |
| 835 | } |
| 836 | |
| 837 | inline void allocate(const int size) { |
| 838 | if (this->vals == nullptr) { |
| 839 | this->size = size; |
| 840 | this->vals = (int*) malloc(sizeof(int) * size); |
| 841 | } |
| 842 | return; |
| 843 | } |
| 844 | |
| 845 | ~HostDnVecInt() { |
| 846 | if (this->vals != nullptr) { |
| 847 | free(this->vals); |
| 848 | this->vals = nullptr; |
| 849 | } |
| 850 | // std::cout << "HostDnVecInt destructor called!" << std::endl; |
| 851 | } |
| 852 | }; |
| 853 | |
| 854 | // dense vector wrapper on host: size_t type |
| 855 | class HostDnVecLongInt { |
nothing calls this directly
no outgoing calls
no test coverage detected