Simple GPU 1.0
Fortran GPU Computing Library with transparent CPU/GPU support
Loading...
Searching...
No Matches
gpu_amd.c File Reference
#include <stdint.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <hipblas/hipblas.h>
#include <hip/hip_runtime.h>
Include dependency graph for gpu_amd.c:

Go to the source code of this file.

Functions

int gpu_ndevices ()
void gpu_set_device (int32_t igpu)
void gpu_get_memory (size_t *free, size_t *total)
void gpu_allocate (void **ptr, const int64_t size)
void gpu_deallocate (void **ptr)
void gpu_free (void **ptr)
void gpu_upload (const void *cpu_ptr, void *gpu_ptr, const int64_t n)
void gpu_download (const void *gpu_ptr, void *cpu_ptr, const int64_t n)
void gpu_copy (const void *gpu_ptr_src, void *gpu_ptr_dest, const int64_t n)
void gpu_stream_create (hipStream_t *ptr)
void gpu_stream_destroy (hipStream_t *ptr)
void gpu_set_stream (hipblasHandle_t handle, hipStream_t stream)
void gpu_synchronize ()
void gpu_stream_synchronize (void *stream)
void gpu_blas_create (hipblasHandle_t *ptr)
void gpu_blas_destroy (hipblasHandle_t *ptr)
void gpu_ddot (hipblasHandle_t handle, const int64_t n, const double *x, const int64_t incx, const double *y, const int64_t incy, double *result)
void gpu_sdot (hipblasHandle_t handle, const int64_t n, const float *x, const int64_t incx, const float *y, const int64_t incy, float *result)
void gpu_dgemv (hipblasHandle_t handle, const char *transa, const int64_t m, const int64_t n, const double *alpha, const double *a, const int64_t lda, const double *x, const int64_t incx, const double *beta, double *y, const int64_t incy)
void gpu_sgemv (hipblasHandle_t handle, const char *transa, const int64_t m, const int64_t n, const float *alpha, const float *a, const int64_t lda, const float *x, const int64_t incx, const float *beta, float *y, const int64_t incy)
void gpu_dgemm (hipblasHandle_t handle, const char *transa, const char *transb, const int64_t m, const int64_t n, const int64_t k, const double *alpha, const double *a, const int64_t lda, const double *b, const int64_t ldb, const double *beta, double *c, const int64_t ldc)
void gpu_sgemm (hipblasHandle_t handle, const char *transa, const char *transb, const int64_t m, const int64_t n, const int64_t k, const float *alpha, const float *a, const int64_t lda, const float *b, const int64_t ldb, const float *beta, float *c, const int64_t ldc)
void gpu_dgeam (hipblasHandle_t handle, const char *transa, const char *transb, const int64_t m, const int64_t n, const double *alpha, const double *a, const int64_t lda, const double *beta, const double *b, const int64_t ldb, double *c, const int64_t ldc)
void gpu_sgeam (hipblasHandle_t handle, const char *transa, const char *transb, const int64_t m, const int64_t n, const float *alpha, const float *a, const int64_t lda, const float *beta, const float *b, const int64_t ldb, float *c, const int64_t ldc)

Function Documentation

◆ gpu_allocate()

void gpu_allocate ( void ** ptr,
const int64_t size )

Definition at line 50 of file gpu_amd.c.

◆ gpu_blas_create()

void gpu_blas_create ( hipblasHandle_t * ptr)

Definition at line 173 of file gpu_amd.c.

◆ gpu_blas_destroy()

void gpu_blas_destroy ( hipblasHandle_t * ptr)

Definition at line 186 of file gpu_amd.c.

◆ gpu_copy()

void gpu_copy ( const void * gpu_ptr_src,
void * gpu_ptr_dest,
const int64_t n )

Definition at line 113 of file gpu_amd.c.

◆ gpu_ddot()

void gpu_ddot ( hipblasHandle_t handle,
const int64_t n,
const double * x,
const int64_t incx,
const double * y,
const int64_t incy,
double * result )

Definition at line 197 of file gpu_amd.c.

◆ gpu_deallocate()

void gpu_deallocate ( void ** ptr)

Definition at line 70 of file gpu_amd.c.

Here is the caller graph for this function:

◆ gpu_dgeam()

void gpu_dgeam ( hipblasHandle_t handle,
const char * transa,
const char * transb,
const int64_t m,
const int64_t n,
const double * alpha,
const double * a,
const int64_t lda,
const double * beta,
const double * b,
const int64_t ldb,
double * c,
const int64_t ldc )

Definition at line 363 of file gpu_amd.c.

◆ gpu_dgemm()

void gpu_dgemm ( hipblasHandle_t handle,
const char * transa,
const char * transb,
const int64_t m,
const int64_t n,
const int64_t k,
const double * alpha,
const double * a,
const int64_t lda,
const double * b,
const int64_t ldb,
const double * beta,
double * c,
const int64_t ldc )

Definition at line 296 of file gpu_amd.c.

◆ gpu_dgemv()

void gpu_dgemv ( hipblasHandle_t handle,
const char * transa,
const int64_t m,
const int64_t n,
const double * alpha,
const double * a,
const int64_t lda,
const double * x,
const int64_t incx,
const double * beta,
double * y,
const int64_t incy )

Definition at line 237 of file gpu_amd.c.

◆ gpu_download()

void gpu_download ( const void * gpu_ptr,
void * cpu_ptr,
const int64_t n )

Definition at line 101 of file gpu_amd.c.

◆ gpu_free()

void gpu_free ( void ** ptr)

Definition at line 82 of file gpu_amd.c.

◆ gpu_get_memory()

void gpu_get_memory ( size_t * free,
size_t * total )

Definition at line 40 of file gpu_amd.c.

◆ gpu_ndevices()

int gpu_ndevices ( )

Definition at line 14 of file gpu_amd.c.

Here is the caller graph for this function:

◆ gpu_sdot()

void gpu_sdot ( hipblasHandle_t handle,
const int64_t n,
const float * x,
const int64_t incx,
const float * y,
const int64_t incy,
float * result )

Definition at line 216 of file gpu_amd.c.

◆ gpu_set_device()

void gpu_set_device ( int32_t igpu)

Definition at line 23 of file gpu_amd.c.

◆ gpu_set_stream()

void gpu_set_stream ( hipblasHandle_t handle,
hipStream_t stream )

Definition at line 146 of file gpu_amd.c.

◆ gpu_sgeam()

void gpu_sgeam ( hipblasHandle_t handle,
const char * transa,
const char * transb,
const int64_t m,
const int64_t n,
const float * alpha,
const float * a,
const int64_t lda,
const float * beta,
const float * b,
const int64_t ldb,
float * c,
const int64_t ldc )

Definition at line 394 of file gpu_amd.c.

◆ gpu_sgemm()

void gpu_sgemm ( hipblasHandle_t handle,
const char * transa,
const char * transb,
const int64_t m,
const int64_t n,
const int64_t k,
const float * alpha,
const float * a,
const int64_t lda,
const float * b,
const int64_t ldb,
const float * beta,
float * c,
const int64_t ldc )

Definition at line 330 of file gpu_amd.c.

◆ gpu_sgemv()

void gpu_sgemv ( hipblasHandle_t handle,
const char * transa,
const int64_t m,
const int64_t n,
const float * alpha,
const float * a,
const int64_t lda,
const float * x,
const int64_t incx,
const float * beta,
float * y,
const int64_t incy )

Definition at line 267 of file gpu_amd.c.

◆ gpu_stream_create()

void gpu_stream_create ( hipStream_t * ptr)

Definition at line 128 of file gpu_amd.c.

◆ gpu_stream_destroy()

void gpu_stream_destroy ( hipStream_t * ptr)

Definition at line 136 of file gpu_amd.c.

◆ gpu_stream_synchronize()

void gpu_stream_synchronize ( void * stream)

Definition at line 162 of file gpu_amd.c.

◆ gpu_synchronize()

void gpu_synchronize ( )

Definition at line 154 of file gpu_amd.c.

◆ gpu_upload()

void gpu_upload ( const void * cpu_ptr,
void * gpu_ptr,
const int64_t n )

Definition at line 89 of file gpu_amd.c.