Added canMapHostMemory feature

[ROCm/hip commit: af4edd277f]
此提交包含在:
Aditya Atluri committed 2016-03-05 13:06:37 -06:00
1 父節點 29c423a22b
當前提交 8b585536ef
2 file changed
+21

No files matched your search

+1
查看文件
@@ -177,6 +177,7 @@ inline static hipError_t hipDeviceGetProperties(hipDeviceProp_t *p_prop, int dev
p_prop->l2CacheSize = cdprop.l2CacheSize ;
p_prop->maxThreadsPerMultiProcessor = cdprop.maxThreadsPerMultiProcessor ;
p_prop->computeMode = cdprop.computeMode ;
p_prop->canMapHostMemory = cdprop.canMapHostMemory;
// Same as clock-rate:
p_prop->clockInstructionRate = cdprop.clockRate;
+20
查看文件
@@ -0,0 +1,20 @@
#include<iostream>
#include"test_common.h"
__global__ void Add(hipLaunchParm lp, float *Ad, float *Bd, float *Cd){
int tx = hipThreadIdx_x + hipBlockIdx_x * hipBlockDim_x;
Cd[tx] = Ad[tx] + Bd[tx];
}
int main(){
float *A, *B, *C;
float *Ad, *Bd, *Cd;
hipDeviceProp_t prop;
int device;
hipGetDevice(&device);
hipDeviceGetProperties(&prop, device);
if(prop.canMapHostMemory != 1){
std::cout<<"Exiting.."<<std::endl;
}
}