Commit 5c809beb authored by BRAMAS Berenger's avatar BRAMAS Berenger

Remove todo from opencl wrapper

parent ba5f1963
......@@ -157,66 +157,10 @@ public:
}
void bottomPassPerform(cl_mem leafCellsPtr, size_t leafCellsSize, cl_mem containersPtr, size_t containersSize){
/*cl_int errcode_ret;
const int size = sizeof(FTestCell);
int* output = new int[size];
cl_mem outputcl = clCreateBuffer(getOpenCLContext(),
CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR,
size*sizeof(int),
(void*)output, &errcode_ret);
FAssertLF(outputcl && errcode_ret == CL_SUCCESS, "OpenCL error code " , errcode_ret);*/
SetKernelArgs(kernel_bottomPassPerform, 0, &leafCellsPtr, &leafCellsSize, &containersPtr, &containersSize, &user_data/*, &outputcl*/);
const int err = clEnqueueNDRangeKernel(queue_bottomPassPerform, kernel_bottomPassPerform, kernelFilename.getNbDims(), NULL,
kernelFilename.getNbGroups(), kernelFilename.getGroupSize(), 0, NULL, NULL);
if (err != CL_SUCCESS) STARPU_OPENCL_REPORT_ERROR(err);
// todo TODO struct starpu_task* tsk = starpu_task_get_current();
// FAssertLF(tsk);
// starpu_data_handle_t handle = STARPU_TASK_GET_HANDLE( tsk, 0);
// FAssertLF(handle);
//starpu_data_acquire(handle, STARPU_RW);
//starpu_data_release(handle);
//uintptr_t dataTest = ((starpu_variable_interface2*)(((_starpu_data_replicate2*)(handle->per_node))->data_interface))->ptr;//((starpu_variable_interface*)(handle->per_node[0]->data_interface))->ptr;
// void* data = starpu_data_get_local_ptr( handle);
// FAssertLF(data && starpu_data_get_size(handle) == leafCellsSize);
// std::cout << "currentCells data " << data << "\n";
//const int errcode_ret = clEnqueueReadBuffer(queue_bottomPassPerform, leafCellsPtr,
// CL_TRUE, 0, leafCellsSize, data, 0, NULL, NULL);
//FAssertLF(errcode_ret == CL_SUCCESS, "OpenCL error code " , errcode_ret);
// for(size_t idx = 0 ; idx < leafCellsSize ; ++idx){
// ((unsigned char*)data)[idx] = 99;
// }
/*errcode_ret = clEnqueueReadBuffer(queue_bottomPassPerform, outputcl,
CL_TRUE, // blocking read
0, // write from the start
sizeof(int) * size,
output, 0, NULL, NULL);
FAssertLF(errcode_ret == CL_SUCCESS, "OpenCL error code " , errcode_ret);
for(int idx = 0 ; idx < 10 ; ++idx){
std::cout << "value " << idx << " = " << output[idx] << "\n";
}
// FTestCell* cell = (FTestCell*)output;
// std::cout << " cell->getDataUp() " << cell->getDataUp() << "\n";
clReleaseMemObject(outputcl);
delete output;*/
/*unsigned char* cpu_leafCellsPtr = new unsigned char[leafCellsSize];
int errcode_ret = clEnqueueReadBuffer(queue_bottomPassPerform, leafCellsPtr,
CL_TRUE, // blocking read
0, // write from the start
leafCellsSize,
cpu_leafCellsPtr, 0, NULL, NULL);
FAssertLF(errcode_ret == CL_SUCCESS, "OpenCL error code " , errcode_ret);
FGroupOfCells<FTestCell> allcells(cpu_leafCellsPtr, leafCellsSize);
std::cout <<" CPU] goes from " << allcells.getStartingIndex() << " to " << allcells.getEndingIndex() << "\n";
FTestCell* firstcell = allcells.getCell(allcells.getStartingIndex());
FAssertLF(firstcell);
std::cout <<" CPU] first cell of index " << firstcell->getMortonIndex() << " has up " << firstcell->getDataUp() << "\n";
delete[] cpu_leafCellsPtr;*/
}
......
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