Welcome to mirror list, hosted at ThFree Co, Russian Federation.

THCStorageCopy.cu « generic « THC « lib - github.com/torch/cutorch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c3205b5c52b0283f0f9409a40a5e2eb087f064ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include "THCStorageCopy.h"
#include "THCGeneral.h"

void THCudaStorage_rawCopy(THCState *state, THCudaStorage *self, float *src)
{
  THCudaCheck(cudaMemcpyAsync(self->data, src, self->size * sizeof(float), cudaMemcpyDeviceToDevice, THCState_getCurrentStream(state)));
}

void THCudaStorage_copy(THCState *state, THCudaStorage *self, THCudaStorage *src)
{
  THArgCheck(self->size == src->size, 2, "size does not match");
  THCudaCheck(cudaMemcpyAsync(self->data, src->data, self->size * sizeof(float), cudaMemcpyDeviceToDevice, THCState_getCurrentStream(state)));
}

void THCudaStorage_copyCuda(THCState *state, THCudaStorage *self, THCudaStorage *src)
{
  THArgCheck(self->size == src->size, 2, "size does not match");
  THCudaCheck(cudaMemcpyAsync(self->data, src->data, self->size * sizeof(float), cudaMemcpyDeviceToDevice, THCState_getCurrentStream(state)));
}