Added a new function to the device interface: acDeviceLoadMeshInfo
This commit is contained in:
@@ -49,6 +49,10 @@ AcResult acDeviceSwapBuffers(const Device device);
|
|||||||
AcResult acDeviceLoadConstant(const Device device, const Stream stream, const AcRealParam param,
|
AcResult acDeviceLoadConstant(const Device device, const Stream stream, const AcRealParam param,
|
||||||
const AcReal value);
|
const AcReal value);
|
||||||
|
|
||||||
|
/** */
|
||||||
|
AcResult acDeviceLoadMeshInfo(const Device device, const Stream stream,
|
||||||
|
const AcMeshInfo device_config);
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
AcResult acDeviceLoadVertexBufferWithOffset(const Device device, const Stream stream,
|
AcResult acDeviceLoadVertexBufferWithOffset(const Device device, const Stream stream,
|
||||||
const AcMesh host_mesh,
|
const AcMesh host_mesh,
|
||||||
|
|||||||
@@ -149,8 +149,7 @@ acDeviceCreate(const int id, const AcMeshInfo device_config, Device* device_hand
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Device constants
|
// Device constants
|
||||||
ERRCHK_CUDA_ALWAYS(cudaMemcpyToSymbol(d_mesh_info, &device_config, sizeof(device_config), 0,
|
acDeviceLoadMeshInfo(device, STREAM_DEFAULT, device_config);
|
||||||
cudaMemcpyHostToDevice));
|
|
||||||
|
|
||||||
printf("Created device %d (%p)\n", device->id, device);
|
printf("Created device %d (%p)\n", device->id, device);
|
||||||
*device_handle = device;
|
*device_handle = device;
|
||||||
@@ -367,6 +366,15 @@ acDeviceLoadConstant(const Device device, const Stream stream, const AcRealParam
|
|||||||
return AC_SUCCESS;
|
return AC_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
AcResult
|
||||||
|
acDeviceLoadMeshInfo(const Device device, const Stream stream, const AcMeshInfo device_config)
|
||||||
|
{
|
||||||
|
cudaSetDevice(device->id);
|
||||||
|
ERRCHK_CUDA_ALWAYS(cudaMemcpyToSymbolAsync(d_mesh_info, &device_config, sizeof(device_config),
|
||||||
|
0, cudaMemcpyHostToDevice, device->streams[stream]));
|
||||||
|
return AC_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
AcResult
|
AcResult
|
||||||
acDeviceLoadVertexBufferWithOffset(const Device device, const Stream stream, const AcMesh host_mesh,
|
acDeviceLoadVertexBufferWithOffset(const Device device, const Stream stream, const AcMesh host_mesh,
|
||||||
const VertexBufferHandle vtxbuf_handle, const int3 src,
|
const VertexBufferHandle vtxbuf_handle, const int3 src,
|
||||||
|
|||||||
Reference in New Issue
Block a user