tensorflow/core/profiler/internal/gpu/cuda_test.cu.cc
// Helper function to set up memory buffers on two devices.
Helper function to set up memory buffers on two devices.
Helper function to set up memory buffers on two devices .
void P2PMemcpyHelper() {
#if GOOGLE_CUDA
  cudaSetDevice(0);
  cudaMalloc(reinterpret_cast<void **>(&gpu0_buf), sizeof(unsigned));
  cudaDeviceEnablePeerAccess(1, 0);
  cudaSetDevice(1);
  cudaMalloc(reinterpret_cast<void **>(&gpu1_buf), sizeof(unsigned));
  cudaDeviceEnablePeerAccess(0, 0);
#else
  GTEST_FAIL() << "Build with --config=cuda";
#endif
}
void P2PMemcpyHelper ( ) { #if GOOGLE_CUDA cudaSetDevice ( 0 ) ; cudaMalloc ( reinterpret_cast < void * * > ( & gpu0_buf ) , sizeof ( unsigned ) ) ; cudaDeviceEnablePeerAccess ( 1 , 0 ) ; cudaSetDevice ( 1 ) ; cudaMalloc ( reinterpret_cast < void * * > ( & gpu1_buf ) , sizeof ( unsigned ) ) ; cudaDeviceEnablePeerAccess ( 0 , 0 ) ; #else GTEST_FAIL ( ) << " " ; #endif }
Helper function to set up memory buffers on two devices.
Helper function to set up memory buffers on two devices .
/*peerDevice=*/ /*flags=*/ /*peerDevice=*/ /*flags=*/