Beispiel #1
0
 public void SetUp()
 {
     _gpu = CudafyHost.GetDevice();
     _sparse = GPGPUSPARSE.Create(_gpu);
     _blas = GPGPUBLAS.Create(_gpu);
     _solver = new Solver(_gpu, _blas, _sparse);
 }
Beispiel #2
0
        public Solver(GPGPU gpu, GPGPUBLAS blas, GPGPUSPARSE sparse)
        {
            this.gpu = gpu;
            this.blas = blas;
            this.sparse = sparse;

            var km = CudafyModule.TryDeserialize();
            if (km == null || !km.TryVerifyChecksums())
            {
                km = CudafyTranslator.Cudafy();
                km.TrySerialize();
            }

            gpu.LoadModule(km);
        }
Beispiel #3
0
        public void SetUp()
        {
            _gpu = CudafyHost.CreateDevice(CudafyModes.Target);
            _sparse = GPGPUSPARSE.Create(_gpu);

            _hiMatrixMN = new double[M * N];
            _hiMatrixMN2 = new double[M * N];
            _hoMatrixMN = new double[M * N];
            _hoPerVector = new int[M];
            _hoPerVector2 = new int[N];

            _diPerVector2 = _gpu.Allocate(_hoPerVector2);
            _diMatrixMN = _gpu.Allocate(_hiMatrixMN);
            _diMatrixMN2 = _gpu.Allocate(_hiMatrixMN2);
            _diPerVector = _gpu.Allocate(_hoPerVector);

        }
Beispiel #4
0
        public void SetUp()
        {
            _gpu = CudafyHost.GetDevice();

            _sparse = GPGPUSPARSE.Create(_gpu);

            hiMatrixMN = new double[M * N];
            hiMatrixMK = new double[M * K];
            hiMatrixKM = new double[K * M];
            hiMatrixKN = new double[K * N];
            hiMatrixNN = new double[N * N];
            hiVectorXM = new double[M];
            hiVectorXN = new double[N];
            hiVectorYM = new double[M];
            hiVectorYN = new double[N];
            gpuResultM = new double[M];
            gpuResultN = new double[N];
            gpuResultMN = new double[M * N];
        }
Beispiel #5
0
        public void SetUp()
        {
            _gpu = CudafyHost.GetDevice();
            _sparse = GPGPUSPARSE.Create(_gpu);
                        
            _hiVectorX = new float[N];
            _hiVectorY = new float[N];
            _hoVectorY = new float[N];

            FillBufferSparse(_hiVectorX, out NNZ);
            FillBuffer(_hiVectorY);

            _hiIndicesX = new int[NNZ];
            _hoValsX = new float[NNZ];
            _hiValsX = new float[NNZ];

            GetSparseIndex(_hiVectorX, _hiValsX, _hiIndicesX);

            _diValsX = _gpu.Allocate(_hiValsX);
            _diIndicesX = _gpu.Allocate(_hiIndicesX);
            _diVectorY = _gpu.Allocate(_hiVectorY);

        }
Beispiel #6
0
 public SharpBLAS(GPGPU gpu)
 {
     Gpu = gpu;
     Blas = GPGPUBLAS.Create(gpu);
     Sparse = GPGPUSPARSE.Create(gpu);
 }