Add runnable GPU main-path prototype

This commit is contained in:
2026-04-08 19:14:37 +08:00
parent 8c1f4d8108
commit ea470737db
10 changed files with 1068 additions and 39 deletions

View File

@@ -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;