Commit 8fe154f0 authored by oscar's avatar oscar

提交修改

parent 89c32f94
......@@ -25,25 +25,25 @@ inline void GPUAssert(cudaError_t code, const char* file, int line, bool abort =
}
//Memory Allocation Function
void cpuMalloc(float **data_ptr, size_t size)
{
float *data;
data = (float *) malloc( size);
*data_ptr = data;
}
//void cpuMalloc(float **data_ptr, size_t size)
//{
// float *data;
// data = (float *) malloc( size);
// *data_ptr = data;
//}
//Ideintity Matrix Generation
void Identity(float *data, int n)
{
for (int i = 0; i < (n*n); i=i+1)
{
if((i%(n+1))==0)
data[i] = 1;
else
data[i] = 0;
}
}
//void Identity(float *data, int n)
//{
// for (int i = 0; i < (n*n); i=i+1)
// {
// if((i%(n+1))==0)
// data[i] = 1;
// else
// data[i] = 0;
// }
//}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment