Add runnable GPU main-path prototype
This commit is contained in:
@@ -18,12 +18,18 @@ using namespace std;
|
||||
#include <fstream>
|
||||
#endif
|
||||
|
||||
void compare_result_gpu(int ftag1,double * datac,int data_num){
|
||||
double * data = (double*)malloc(sizeof(double)*data_num);
|
||||
cudaMemcpy(data, datac, data_num * sizeof(double), cudaMemcpyDeviceToHost);
|
||||
compare_result(ftag1,data,data_num);
|
||||
free(data);
|
||||
}
|
||||
void compare_result_gpu(int ftag1,double * datac,int data_num){
|
||||
#ifdef RESULT_CHECK
|
||||
double * data = (double*)malloc(sizeof(double)*data_num);
|
||||
cudaMemcpy(data, datac, data_num * sizeof(double), cudaMemcpyDeviceToHost);
|
||||
compare_result(ftag1,data,data_num);
|
||||
free(data);
|
||||
#else
|
||||
(void)ftag1;
|
||||
(void)datac;
|
||||
(void)data_num;
|
||||
#endif
|
||||
}
|
||||
|
||||
__global__ void test_const_address(double * testd){
|
||||
int _t = blockIdx.x*blockDim.x+threadIdx.x;
|
||||
|
||||
Reference in New Issue
Block a user