Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 98cea999 authored by BRAMAS Berenger's avatar BRAMAS Berenger
Browse files

update for opencl (but stop here, and switch to cuda)

parent 364e647f
This diff is collapsed.
#ifndef FUNIFORMOPENCLCODE_HPP
#define FUNIFORMOPENCLCODE_HPP
#include "../../Utils/FGlobal.hpp"
#include "../StarPUUtils/FStarPUDefaultAlign.hpp"
#include "../OpenCl/FTextReplacer.hpp"
#include "../../Kernels/Uniform/FUnifCell.hpp"
// Initialize the types
template <class FReal, const int ORDER>
class FUniformOpenCLCode{
FTextReplacer kernelfile;
size_t dim;
public:
FUniformOpenCLCode() : kernelfile("../Src/GroupTree/Uniform/FUniformKernel.cl"){
if(sizeof(FReal) == sizeof(double)){
kernelfile.replaceAll("___FReal___", "double");
}
else{
kernelfile.replaceAll("___FReal___", "float");
}
FAssertLF((typeid(FSize) == typeid(long long int)));
kernelfile.replaceAll("___FSize___", "long long int");
kernelfile.replaceAll("___FParticleValueClass___", "long long");
kernelfile.replaceAll("___NbSymbAttributes___", 0);
kernelfile.replaceAll("___NbAttributesPerParticle___", 1);
const size_t structAlign = FStarPUDefaultAlign::StructAlign;
kernelfile.replaceAll("___DefaultStructAlign___", structAlign);
kernelfile.replaceAll("___FP2PDefaultAlignement___", FP2PDefaultAlignement);
kernelfile.replaceAll("__ORDER__", ORDER);
FUnifCell<FReal, ORDER> cell;
kernelfile.replaceAll("__POLE_SIZE__", cell.getVectorSize());
kernelfile.replaceAll("__LOCAL_SIZE__", cell.getVectorSize());
dim = 1;
}
const char* getKernelCode(const int /*inDevId*/){
return kernelfile.getContent();
}
void releaseKernelCode(){
kernelfile.clear();
}
unsigned int getNbDims() const {
return 1;
}
const size_t* getNbGroups(const int /*inSizeInterval*/) const {
// We return 1
return &dim;
}
const size_t* getGroupSize() const {
// We return 1
return &dim;
}
};
#endif // FUNIFORMOPENCLCODE_HPP
......@@ -44,13 +44,15 @@
#include "../../Src/GroupTree/OpenCl/FOpenCLDeviceWrapper.hpp"
int main(int argc, char* argv[]){
setenv("STARPU_NCPU","0",1);
setenv("STARPU_NOPENCL","1",1);
//setenv("STARPU_OPENCL_ONLY_ON_CPUS","1",1);
setenv("STARPU_OPENCL_ON_CPUS","1",1);
setenv("STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY","1",1);
setenv("STARPU_OPENCL_PIPELINE","0",0); // synchronous task
if(getenv("HOSTNAME") && strcmp(getenv("HOSTNAME"),"berenger-HP-ProBook-640-G1") == 0){
setenv("STARPU_NCPU","0",1);
setenv("STARPU_NOPENCL","1",1);
setenv("STARPU_OPENCL_ONLY_ON_CPUS","1",1);
setenv("STARPU_OPENCL_ON_CPUS","1",1);
setenv("STARPU_DISABLE_ASYNCHRONOUS_OPENCL_COPY","1",1);
setenv("STARPU_OPENCL_PIPELINE","0",0); // synchronous task
}
const FParameterNames LocalOptionBlocSize {
{"-bs"},
......
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