hipMemsetD8 support for HIP/NVCC path
Change-Id: I48eee8266afd7b45a12d5ce2c4849b687a006c0f
This commit is contained in:
@@ -397,6 +397,11 @@ inline static hipError_t hipMemsetAsync(void* devPtr,int value, size_t count, hi
|
||||
return hipCUDAErrorTohipError(cudaMemsetAsync(devPtr, value, count, stream));
|
||||
}
|
||||
|
||||
inline static hipError_t hipMemsetD8(hipDeviceptr_t dest, unsigned char value, size_t sizeBytes )
|
||||
{
|
||||
return hipCUResultTohipError(cuMemsetD8(dest, value, sizeBytes));
|
||||
}
|
||||
|
||||
inline static hipError_t hipGetDeviceProperties(hipDeviceProp_t *p_prop, int device)
|
||||
{
|
||||
cudaDeviceProp cdprop;
|
||||
|
||||
@@ -45,13 +45,13 @@ int main(int argc, char *argv[])
|
||||
hipDeviceptr_t A_d;
|
||||
A_h = new char[Nbytes];
|
||||
|
||||
HIPCHECK ( hipMalloc(&A_d, Nbytes) );
|
||||
HIPCHECK ( hipMalloc((void **) &A_d, Nbytes) );
|
||||
A_h = (char*)malloc(Nbytes);
|
||||
|
||||
printf ("Size=%zu memsetval=%2x \n", Nbytes, memsetval);
|
||||
HIPCHECK ( hipMemsetD8(A_d, memsetval, Nbytes) );
|
||||
|
||||
HIPCHECK ( hipMemcpy(A_h, A_d, Nbytes, hipMemcpyDeviceToHost));
|
||||
HIPCHECK ( hipMemcpy(A_h, (void *) A_d, Nbytes, hipMemcpyDeviceToHost));
|
||||
|
||||
for (int i=0; i<N; i++) {
|
||||
if (A_h[i] != memsetval) {
|
||||
@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
hipFree(A_d);
|
||||
hipFree((void *) A_d);
|
||||
free(A_h);
|
||||
passed();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user