SP: Remove MFEM specific CUDA vector methods.
@@ -55,33 +55,6 @@ public:
allocate();
}
- /// This is temporary solution will be removed.
- /// Use only if you know what you are doing.
- Vector(I N, T* data)
- : size_(N),
- mem_size_(N*sizeof(T)),
- ownPartitioning_(true),
- isClone_(false),
- ownHostData_(false),
- ownDevData_(false)
- {
- // Set partitioning
- partStream_ = new StreamPartitioning<T, I>(N, 256);
- partReduce_ = new ReducePartitioning<T, I>(N, 256);
-
- if (data == NULL)
- {
- h_vec_ = NULL;
- d_vec_ = NULL;
- }
- else
- {
- // Sets pointer to device memory and allocates host memory of size N
- allocate(data);
- ownHostData_ = true;
- }
- }
-
/// Copy constructor does not copy values
explicit Vector(const Vector& v)
: size_(v.size()),
@@ -118,18 +91,6 @@ public:
std::cout << "Failed to allocate device vector (error code " << err << ")!\n";
}
- /// This is temporary solution! Use only if you know what you are doing.
- void allocate(T* data)
- {
- // Allocate host data
- h_vec_ = static_cast<T*>(malloc(mem_size_));
- if(h_vec_ == NULL)
- std::cout << "Failed to allocate host vector!\n";
-
- // Set pointer to device data
- d_vec_ = data;
- }
-
void clear()
{
if(ownHostData_)
@@ -188,32 +149,6 @@ public:
std::cout << "Failed to copy vector from device to host (error code " << err << ")!\n";
}
- /// This is dangerous function and is here only temporary. It will be removed.
- void setFromHost(T* h_vec)
- {
- if (ownHostData_)
- {
- free(h_vec_);
- ownHostData_ = false;
- }
- h_vec_ = h_vec;
- copyToDev();
- }
-
- /// This is dangerous function and is here only temporary. It will be removed.
- void setFromDevice(T* d_vec)
- {
- if(ownDevData_)
- {
- cudaError_t err = cudaFree(d_vec_);
- if(err != cudaSuccess)
- std::cout << "Failed to free device vector (error code " << err << ")!\n";
- ownDevData_ = false;
- }
- d_vec_ = d_vec;
- // Do not copy to host
- }
-
StreamPartitioning<T, I>& partStream() const
{
return *partStream_;
