GpuMat 1.0.1
A GpuMat for CS205 C/C++ Project4
Loading...
Searching...
No Matches
How to use GpuMat

Welcome to the documentation for GpuMat. This document provides an overview of the project's features and usage instructions.

Features

  • 2D array
  • Matrix on GPU
  • Genetics

Installation

To download GpuMat, follow these steps:

  1. Clone the repository: https://github.com/Laihb1106205841/GpuMat.github.io.git
  2. add include "h.cu"
  3. Read document on this site

Example

Here's a simple example of how to use My Project:

#include "matr.h"
int main() {
const size_t rows = 8000;
const int cols = 8000;
Matrix<float> A(rows, cols);
Matrix<float> B(rows, cols);
for (float i = 0; i < rows; ++i) {
for (float j = 0; j < cols; ++j) {
A(i, j) = i+j;
B(i, j) = j-j;
}
}
Matrix<float> D = A * B; // 重写*
}
__global__ void matrixMulKernel(T *a, T *b, T *result, size_t aRows, size_t aCols, size_t bCols)
mul Kernel be faster! https://github.com/njuhope/cuda_sgemm/blob/master/gemm.cu
Definition a1.cpp:244
Base MAT class for GPU memory with reference counting.
Definition a1.cpp:343
int main()
Definition main.cpp:7