-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcuda_MP2.cuh
31 lines (24 loc) · 893 Bytes
/
cuda_MP2.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef CUDA_MP2_CUH
#define CUDA_MP2_CUH
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <fstream>
#include <cuda.h>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
#include "cuda_MP2_matrixmul.h"
using namespace std;
__global__ void MatrixMulKernel(Matrix M, Matrix N, Matrix P);
int cuda_MP2(int argc, char* argv[]);
Matrix AllocateMatrix(int height, int width, int init);
int ReadFile(Matrix* M, char* file_name);
void MatrixMulOnDevice(const Matrix M, const Matrix N, Matrix P);
Matrix AllocateDeviceMatrix(const Matrix M);
void CopyToDeviceMatrix(Matrix Mdevice, const Matrix Mhost);
void CopyFromDeviceMatrix(Matrix Mhost, const Matrix Mdevice);
void computeGold(float* C, const float* A, const float* B, unsigned int hA,
unsigned int wA, unsigned int wB);
void WriteFile(Matrix M, char* file_name);
#endif // !CUDA_MP2_CUH