Example #1
0
func errorString(ret C.cudaError_t) error {
	if ret == C.cudaSuccess {
		return nil
	}
	err := C.GoString(C.cudaGetErrorString(ret))
	return fmt.Errorf("cuda: %v", err)
}
Example #2
0
func cudaErr(ret C.cudaError_t) error {
	if ret == C.cudaSuccess {
		return nil
	}
	err := C.GoString(C.cudaGetErrorString(ret))
	return errors.New(err)
}
Example #3
0
// Message string for the error
func GetErrorString(err Error) string {
	return C.GoString(C.cudaGetErrorString(C.cudaError_t(int(err))))
}