mirror of
https://gitlab.com/scemama/qp_plugins_scemama.git
synced 2024-11-08 23:23:42 +01:00
Compare commits
No commits in common. "4d2adddbd9d6547999ad330245dca463ab806300" and "29903111f4169e0d019f56e0cdc242e32d931ce7" have entirely different histories.
4d2adddbd9
...
29903111f4
@ -5,7 +5,6 @@
|
||||
#include <cublas_v2.h>
|
||||
#include <cuda_runtime.h>
|
||||
#include <assert.h>
|
||||
#include "gpu.h"
|
||||
|
||||
#define BLOCK_SIZE 16
|
||||
|
||||
@ -28,13 +27,13 @@ void gpu_dgemm(char transa, char transb, int m, int n, int k, double alpha,
|
||||
cublasOperation_t ta, tb;
|
||||
|
||||
if (transa == 'N') {
|
||||
cudaStat = gpu_malloc((void**)&d_A, (size_t) lda*k*sizeof(double));
|
||||
cudaStat = cudaMalloc((void**)&d_A, (size_t) lda*k*sizeof(double));
|
||||
assert(cudaStat == cudaSuccess);
|
||||
cudaStat = cublasSetMatrix(m, k, sizeof(double), A, lda, d_A, lda);
|
||||
assert(cudaStat == cudaSuccess);
|
||||
ta = CUBLAS_OP_N;
|
||||
} else {
|
||||
cudaStat = gpu_malloc((void**)&d_A, (size_t) lda*m*sizeof(double));
|
||||
cudaStat = cudaMalloc((void**)&d_A, (size_t) lda*m*sizeof(double));
|
||||
assert(cudaStat == cudaSuccess);
|
||||
cudaStat = cublasSetMatrix(k, m, sizeof(double), A, lda, d_A, lda);
|
||||
assert(cudaStat == cudaSuccess);
|
||||
@ -42,20 +41,20 @@ void gpu_dgemm(char transa, char transb, int m, int n, int k, double alpha,
|
||||
}
|
||||
|
||||
if (transb == 'N') {
|
||||
cudaStat = gpu_malloc((void**)&d_B, (size_t) ldb*n*sizeof(double));
|
||||
cudaStat = cudaMalloc((void**)&d_B, (size_t) ldb*n*sizeof(double));
|
||||
assert(cudaStat == cudaSuccess);
|
||||
cudaStat = cublasSetMatrix(k, n, sizeof(double), B, ldb, d_B, ldb);
|
||||
assert(cudaStat == cudaSuccess);
|
||||
tb = CUBLAS_OP_N;
|
||||
} else {
|
||||
cudaStat = gpu_malloc((void**)&d_B, (size_t) ldb*k*sizeof(double));
|
||||
cudaStat = cudaMalloc((void**)&d_B, (size_t) ldb*k*sizeof(double));
|
||||
assert(cudaStat == cudaSuccess);
|
||||
cudaStat = cublasSetMatrix(n, k, sizeof(double), B, ldb, d_B, ldb);
|
||||
assert(cudaStat == cudaSuccess);
|
||||
tb = CUBLAS_OP_T;
|
||||
}
|
||||
|
||||
cudaStat = gpu_malloc((void**)&d_C, (size_t) ldc*n*sizeof(double));
|
||||
cudaStat = cudaMalloc((void**)&d_C, (size_t) ldc*n*sizeof(double));
|
||||
assert(cudaStat == cudaSuccess);
|
||||
if (beta != 0.) {
|
||||
cudaStat = cublasSetMatrix(m, n, sizeof(double), C, ldc, d_C, ldc);
|
||||
|
Loading…
Reference in New Issue
Block a user