Browse Source

Fix build breaks, breakeventHtoDMemcpy.cu

master
--set 5 months ago
parent
commit
b521b2eadb
  1. 14
      concurrency/breakevenHtoDMemcpy.cu

14
concurrency/breakevenHtoDMemcpy.cu

@ -38,17 +38,13 @@
#include <stdio.h> #include <stdio.h>
#ifdef __HIPCC__
#endif
#include "chError.h" #include "chError.h"
#include "chTimer.h" #include "chTimer.h"
int int
main( int argc, char *argv[] ) main( int argc, char *argv[] )
{ {
hipError_t status; cudaError_t status;
int *deviceInt = 0; int *deviceInt = 0;
int *hostInt = 0; int *hostInt = 0;
const int cIterations = 100000; const int cIterations = 100000;
@ -62,7 +58,7 @@ main( int argc, char *argv[] )
chTimerTimestamp start, stop; chTimerTimestamp start, stop;
cuda(Malloc( &deviceInt, numBytes ) ); cuda(Malloc( &deviceInt, numBytes ) );
cuda(HostMalloc( (void **) &hostInt, numBytes, 0 ) ); cuda(HostAlloc( (void **) &hostInt, numBytes, 0 ) );
for ( size_t byteCount = byteIncrement; for ( size_t byteCount = byteIncrement;
byteCount <= numBytes; byteCount <= numBytes;
@ -72,7 +68,7 @@ main( int argc, char *argv[] )
chTimerGetTime( &start ); chTimerGetTime( &start );
for ( int i = 0; i < cIterations; i++ ) { for ( int i = 0; i < cIterations; i++ ) {
cuda(MemcpyAsync( deviceInt, hostInt, byteCount, cuda(MemcpyAsync( deviceInt, hostInt, byteCount,
hipMemcpyHostToDevice, NULL ) ); cudaMemcpyHostToDevice, NULL ) );
} }
cuda(DeviceSynchronize() ); cuda(DeviceSynchronize() );
chTimerGetTime( &stop ); chTimerGetTime( &stop );
@ -85,8 +81,8 @@ main( int argc, char *argv[] )
} }
hipFree( deviceInt ); cudaFree( deviceInt );
hipHostFree( hostInt ); cudaFreeHost( hostInt );
return 0; return 0;
Error: Error:
printf( "Error performing allocation\n" ); printf( "Error performing allocation\n" );

Loading…
Cancel
Save