FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
k32s kCudaStatus_Filter ( k32s  cudaStatus)

Ensures that Cuda eror state is cleared after making a Cuda runtime call.

The Cuda runtime accumulates all past errors until they are explicitly cleared. This approach conflicts with FireSync platform conventions, which recommend that errors should be reported via status codes returned by functions, but not otherwise maintained.

As such, this method can be used to wrap calls to the Cuda runtime. The status code returned by this method is the same as the status code passed to this method. However, if the status code is not equal to cudaSuccess, then the cudaGetLastError method will be called, clearing Cuda's error state for the current thread.

Parameters
cudaStatusCuda runtime status code.
Returns
Cuda runtime status code (same as cudaStatus argument).