Commit fcb8e054 authored by BRAMAS Berenger's avatar BRAMAS Berenger

update opencl starpu code

parent b7836e70
......@@ -121,7 +121,7 @@ public:
struct starpu_conf conf;
FAssertLF(starpu_conf_init(&conf) == 0);
conf.ncpus = MaxThreads;
// conf.ncpus = MaxThreads;
FAssertLF(starpu_init(&conf) == 0);
starpu_pthread_mutex_t initMutex;
......@@ -161,7 +161,14 @@ public:
initCodelet();
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max Thread " << MaxThreads << ")\n");
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max Worker " << starpu_worker_get_count() << ")\n");
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max CPU " << starpu_cpu_worker_get_count() << ")\n");
#ifdef ScalFMM_ENABLE_OPENCL_KERNEL
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max OpenCL " << starpu_opencl_worker_get_count() << ")\n");
#endif
#ifdef ScalFMM_ENABLE_CUDA_KERNEL
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max CUDA " << starpu_cuda_worker_get_count() << ")\n");
#endif
}
~FGroupTaskStarPUAlgorithm(){
......
......@@ -137,7 +137,7 @@ public:
struct starpu_conf conf;
FAssertLF(starpu_conf_init(&conf) == 0);
conf.ncpus = MaxThreads;
//conf.ncpus = MaxThreads;
FAssertLF(starpu_init(&conf) == 0);
FAssertLF(starpu_mpi_init ( 0, 0, 0 ) == 0);
......@@ -179,7 +179,14 @@ public:
initCodelet();
initCodeletMpi();
FLOG(FLog::Controller << "FGroupTaskStarPUMpiAlgorithm (Max Thread " << MaxThreads << ")\n");
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max Worker " << starpu_worker_get_count() << ")\n");
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max CPU " << starpu_cpu_worker_get_count() << ")\n");
#ifdef ScalFMM_ENABLE_OPENCL_KERNEL
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max OpenCL " << starpu_opencl_worker_get_count() << ")\n");
#endif
#ifdef ScalFMM_ENABLE_CUDA_KERNEL
FLOG(FLog::Controller << "FGroupTaskStarPUAlgorithm (Max CUDA " << starpu_cuda_worker_get_count() << ")\n");
#endif
}
~FGroupTaskStarPUMpiAlgorithm(){
......
......@@ -54,7 +54,7 @@ public:
void initKernel(const int workerId, KernelClass* originalKernel){
FAssertLF(kernels[workerId] == nullptr);
kernels[workerId] = new OpenCLKernelClass();
kernels[workerId] = new OpenCLKernelClass(treeHeight);
kernels[workerId]->initDeviceFromKernel(*originalKernel);
}
......
......@@ -475,7 +475,7 @@ __kernel void FOpenCL__bottomPassPerform(__global unsigned char* leafCellsPtr, s
__kernel void FOpenCL__upwardPassPerform(__global unsigned char* currentCellsPtr, size_t currentCellsSize,
struct Uptr9 subCellGroupsPtr, struct size_t9 subCellGroupsSize,
__global void* userkernel, int nbSubCellGroups, int idxLevel){
int nbSubCellGroups, int idxLevel, __global void* userkernel){
struct FOpenCLGroupOfCells currentCells = BuildFOpenCLGroupOfCells(currentCellsPtr, currentCellsSize);
struct FOpenCLGroupOfCells subCellGroups[9];
for(int idx = 0 ; idx < nbSubCellGroups ; ++idx){
......@@ -521,8 +521,8 @@ __kernel void FOpenCL__upwardPassPerform(__global unsigned char* currentCellsPtr
__kernel void FOpenCL__transferInoutPassPerformMpi(__global unsigned char* currentCellsPtr, size_t currentCellsSize,
__global unsigned char* externalCellsPtr, size_t externalCellsSize,
__global void* userkernel, int idxLevel, const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions){
int idxLevel, const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, __global void* userkernel){
struct FOpenCLGroupOfCells currentCells = BuildFOpenCLGroupOfCells(currentCellsPtr, currentCellsSize);
struct FOpenCLGroupOfCells cellsOther = BuildFOpenCLGroupOfCells(externalCellsPtr, externalCellsSize);
......@@ -551,7 +551,7 @@ __kernel void FOpenCL__transferInoutPassPerformMpi(__global unsigned char* curr
__kernel void FOpenCL__transferInPassPerform(__global unsigned char* currentCellsPtr, size_t currentCellsSize,
__global void* userkernel, int idxLevel){
int idxLevel, __global void* userkernel){
struct FOpenCLGroupOfCells currentCells = BuildFOpenCLGroupOfCells(currentCellsPtr, currentCellsSize);
const MortonIndex blockStartIdx = FOpenCLGroupOfCells_getStartingIndex(&currentCells);
......@@ -591,8 +591,8 @@ __kernel void FOpenCL__transferInPassPerform(__global unsigned char* currentCel
__kernel void FOpenCL__transferInoutPassPerform(__global unsigned char* currentCellsPtr, size_t currentCellsSize,
__global unsigned char* externalCellsPtr, size_t externalCellsSize,
__global void* userkernel, int idxLevel, const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions){
int idxLevel, const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, __global void* userkernel){
struct FOpenCLGroupOfCells currentCells = BuildFOpenCLGroupOfCells(currentCellsPtr, currentCellsSize);
struct FOpenCLGroupOfCells cellsOther = BuildFOpenCLGroupOfCells(externalCellsPtr, externalCellsSize);
......@@ -626,7 +626,7 @@ __kernel void FOpenCL__transferInoutPassPerform(__global unsigned char* currentC
__kernel void FOpenCL__downardPassPerform(__global unsigned char* currentCellsPtr, size_t currentCellsSize,
struct Uptr9 subCellGroupsPtr, struct size_t9 subCellGroupsSize,
__global void* userkernel, int nbSubCellGroups, int idxLevel){
int nbSubCellGroups, int idxLevel, __global void* userkernel){
FOpenCLAssertLF(nbSubCellGroups != 0);
struct FOpenCLGroupOfCells currentCells = BuildFOpenCLGroupOfCells(currentCellsPtr, currentCellsSize);
struct FOpenCLGroupOfCells subCellGroups[9];
......@@ -672,8 +672,8 @@ __kernel void FOpenCL__downardPassPerform(__global unsigned char* currentCellsPt
__kernel void FOpenCL__directInoutPassPerformMpi(__global unsigned char* containersPtr, size_t containersSize,
__global unsigned char* externalContainersPtr, size_t externalContainersSize,
__global void* userkernel, const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight){
const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight, __global void* userkernel){
struct FOpenCLGroupOfParticles containers = BuildFOpenCLGroupOfParticles(containersPtr, containersSize);
struct FOpenCLGroupOfParticles containersOther = BuildFOpenCLGroupOfParticles(externalContainersPtr, externalContainersSize);
......@@ -696,7 +696,7 @@ __kernel void FOpenCL__directInoutPassPerformMpi(__global unsigned char* contain
__kernel void FOpenCL__directInPassPerform(__global unsigned char* containersPtr, size_t containersSize,
__global void* userkernel, const int treeHeight){
const int treeHeight, __global void* userkernel){
struct FOpenCLGroupOfParticles containers = BuildFOpenCLGroupOfParticles(containersPtr, containersSize);
const MortonIndex blockStartIdx = FOpenCLGroupOfParticles_getStartingIndex(&containers);
......@@ -733,8 +733,8 @@ __kernel void FOpenCL__directInPassPerform(__global unsigned char* containersPtr
__kernel void FOpenCL__directInoutPassPerform(__global unsigned char* containersPtr, size_t containersSize,
__global unsigned char* externalContainersPtr, size_t externalContainersSize,
__global void* userkernel, const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight){
const __global OutOfBlockInteraction* outsideInteractions,
int nbOutsideInteractions, const int treeHeight, __global void* userkernel){
struct FOpenCLGroupOfParticles containers = BuildFOpenCLGroupOfParticles(containersPtr, containersSize);
struct FOpenCLGroupOfParticles containersOther = BuildFOpenCLGroupOfParticles(externalContainersPtr, externalContainersSize);
......
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