This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
project(cudamemcpy) | |
include(FindCUDA) | |
include_directories(${CUDA_INCLUDE_DIRS}) | |
set( SRCS cudamemcpy.cpp ) | |
add_executable( cudamemcpy ${SRCS} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmake_minimum_required(VERSION 2.8) | |
project(cudaptrinfo) | |
include(FindCUDA) | |
include_directories(${CUDA_INCLUDE_DIRS}) | |
set( SRCS cudaptrinfo.cpp ) | |
add_executable( cudaptrinfo ${SRCS} ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void device_binding () | |
{ | |
int local_rank, num_local_procs; | |
int dev_count, use_dev_count, my_dev_id; | |
char *str; | |
if ((str = getenv ("MV2_COMM_WORLD_LOCAL_RANK")) != NULL) | |
{ | |
local_rank = atoi (str); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/opt/nvidia_gpu_sdk/4.2/C/bin/linux/release/bandwidthTest --csv --mode=range --memory=pageable --htod --start=1000 --end=100000 --increment=1000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
char* str = NULL; | |
if( ( str = getenv( "MV2_USE_CUDA" ) ) != NULL) { | |
printf( "MVAPICH2-CUDA ENABLED: %s\n" ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define CHECK_ERROR( err ) \ | |
if( err != cudaSuccess ) { \ | |
std::cerr << "ERROR: " << cudaGetErrorString( err ) << std::endl; \ | |
exit( -1 ); \ | |
} | |
#define CHECK_LAST_ERROR \ | |
{ cudaError_t err = cudaGetLastError(); \ | |
if( err != cudaSuccess ) { \ | |
std::cerr << cudaGetErrorString( err ) << std::endl; \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-D__cudart_builtin__=__device__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
#include <unistd.h> | |
#include <mpi.h> | |
#include <CL/cl.h> | |
int main( int argc, char** argv ) { | |
cl_int error; | |
cl_platform_id platform; | |
cl_device_id device; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CUDAEventTimer { | |
public: | |
CUDAEventTimer() { | |
cudaEventCreate(&start_); | |
cudaEventCreate(&stop_); | |
} | |
~CUDAEventTimer() { | |
cudaEventDestroy(start_); | |
cudaEventDestroy(stop_); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
//#include <cstdio> - uncomment for printf in kernels | |
//#include <cuda_runtime.h> | |
//cuda is included automatically when compiling with nvcc | |
typedef double REAL_T; | |
//----------------------------------------------------------------------------- | |
class CUDAEventTimer { |
OlderNewer