Added errorchecking and more flexibility the the new acDeviceLoadScalarArray function
This commit is contained in:
@@ -63,8 +63,8 @@ AcResult acDeviceLoadInt3Constant(const Device device, const Stream stream, cons
|
|||||||
|
|
||||||
/** */
|
/** */
|
||||||
AcResult acDeviceLoadScalarArray(const Device device, const Stream stream,
|
AcResult acDeviceLoadScalarArray(const Device device, const Stream stream,
|
||||||
const ScalarArrayHandle handle, const AcReal* data,
|
const ScalarArrayHandle handle, const size_t start,
|
||||||
const size_t num);
|
const AcReal* data, const size_t num);
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
AcResult acDeviceLoadMeshInfo(const Device device, const Stream stream,
|
AcResult acDeviceLoadMeshInfo(const Device device, const Stream stream,
|
||||||
|
|||||||
@@ -449,10 +449,15 @@ acDeviceLoadInt3Constant(const Device device, const Stream stream, const AcInt3P
|
|||||||
|
|
||||||
AcResult
|
AcResult
|
||||||
acDeviceLoadScalarArray(const Device device, const Stream stream, const ScalarArrayHandle handle,
|
acDeviceLoadScalarArray(const Device device, const Stream stream, const ScalarArrayHandle handle,
|
||||||
const AcReal* data, const size_t num)
|
const size_t start, const AcReal* data, const size_t num)
|
||||||
{
|
{
|
||||||
cudaSetDevice(device->id);
|
cudaSetDevice(device->id);
|
||||||
ERRCHK_CUDA(cudaMemcpyAsync(device->vba.profiles[handle], data, sizeof(data[0]) * num,
|
|
||||||
|
ERRCHK(start + num <= max(device->local_config.int_params[AC_mx],
|
||||||
|
max(device->local_config.int_params[AC_my],
|
||||||
|
device->local_config.int_params[AC_mz])));
|
||||||
|
|
||||||
|
ERRCHK_CUDA(cudaMemcpyAsync(&device->vba.profiles[handle][start], data, sizeof(data[0]) * num,
|
||||||
cudaMemcpyHostToDevice, device->streams[stream]));
|
cudaMemcpyHostToDevice, device->streams[stream]));
|
||||||
return AC_SUCCESS;
|
return AC_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user