Function copy_from
Summary
#include <include/thundergbm/syncarray.h>
(1) void copy_from(const T *source, size_t count)
(2) void copy_from(const SyncArray< T > &source)
Function overload
Synopsis
#include <include/thundergbm/syncarray.h>
void copy_from(const T *source, size_t count)
Description
copy device data. This will call to_device() implicitly.
- Parameters
source
- source data pointer (data can be on host or device)count
- the count of elements
Source
Lines 80-87 in include/thundergbm/syncarray.h.
void copy_from(const T *source, size_t count) {
ef USE_CUDA
thunder::device_mem_copy(mem->device_data(), source, sizeof(T) * count);
e
memcpy(mem->host_data(), source, sizeof(T) * count);
if
};
Synopsis
#include <include/thundergbm/syncarray.h>
void copy_from(const SyncArray< T > &source)
Description
No description yet.
Source
Lines 89-101 in include/thundergbm/syncarray.h.
void copy_from(const SyncArray<T> &source) {
CHECK_EQ(size(), source.size()) << "destination and source count doesn't match";
ef USE_CUDA
if (get_owner_id() == source.get_owner_id())
copy_from(source.device_data(), source.size());
else
CUDA_CHECK(cudaMemcpyPeer(mem->device_data(), get_owner_id(), source.device_data(), source.get_owner_id(),
source.mem_size()));
e
copy_from(source.host_data(), source.size());
if
};