cudago

package module
v0.0.0-...-1a6b745 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2022 License: MIT Imports: 1 Imported by: 0

README

Go package cudago

go mascot

Go Reference

See CUDA official page for CUDA library info and doc.

cudago use dynamic library function calls for Go developers run CUDA with Go's other features.

cudago provides Windows and Linux platform implementation for CUDA users.

Notice: cudago only support 64-bit system!

Support OS and arch are shown at below table:

OS/arch supported?
Windows/amd64 support
Linux/amd64 under construction
Windows/arm64 not test
Linux/amd64 not test

karkli, mail: karkli@tencent.com

Documentation

Overview

package cudago implements translation between CUDA C library and Go.

Index

Constants

View Source
const (
	RetCUDAErrt = CUDARetType(0) // return type: cudaError_t
	RetString   = CUDARetType(1) // return type: char */const char *
)
View Source
const (
	CUDAMemcpyHostToHost     = CUDAMemcpyKind(0) /**< Host   -> Host */
	CUDAMemcpyHostToDevice   = CUDAMemcpyKind(1) /**< Host   -> Device */
	CUDAMemcpyDeviceToHost   = CUDAMemcpyKind(2) /**< Device -> Host */
	CUDAMemcpyDeviceToDevice = CUDAMemcpyKind(3) /**< Device -> Device */
	CUDAMemcpyDefault        = CUDAMemcpyKind(4) /**< Direction of the traμsfer is inferred from the pointer values. Requires unified virtual addressing */
)
View Source
const (
	CudaLimitStackSize                    = CudaLimit(0x00) /**< GPU thread stack size */
	CudaLimitPrintfFifoSize               = CudaLimit(0x01) /**< GPU printf FIFO size */
	CudaLimitMallocHeapSize               = CudaLimit(0x02) /**< GPU malloc heap size */
	CudaLimitDevRuntimeSyncDepth          = CudaLimit(0x03) /**< GPU device runtime synchronize depth */
	CudaLimitDevRuntimePendingLaunchCount = CudaLimit(0x04) /**< GPU device runtime pending launch count */
	CudaLimitMaxL2FetchGranularity        = CudaLimit(0x05) /**< A value between 0 and 128 that indicates the maximum fetch granularity of L2 (in Bytes). This is a hint */
)
View Source
const (
	CudaFuncCachePreferNone   = CudaFuncCache(0) /**< Default function cache configuration, no preference */
	CudaFuncCachePreferShared = CudaFuncCache(1) /**< Prefer larger shared memory and smaller L1 cache  */
	CudaFuncCachePreferL1     = CudaFuncCache(2) /**< Prefer larger L1 cache and smaller shared memory */
	CudaFuncCachePreferEqual  = CudaFuncCache(3) /**< Prefer equal size L1 cache and shared memory */
)

Variables

This section is empty.

Functions

func Version

func Version() int

Version returns library match CUDA version

Types

type CUDAMemcpyKind

type CUDAMemcpyKind int

CUDAMemcpyKind - CUDA library enum type cudaMemcpyKind

type CUDARetType

type CUDARetType int

CUDARetType for CUDA function return value type

Now support cudaError_t, char * and const char *

type CudaCall

type CudaCall interface {
	// CallCUDAFuncRetInt Call CUDA library function with return type cudaError_t
	CallCUDAFuncRetInt(funcName string, p ...interface{}) (r int, err error)
	// CallCUDAFuncRetString Call CUDA library function with return type char */const char *
	CallCUDAFuncRetString(funcName string, p ...interface{}) (r string, err error)
}

CudaCall interface for call CUDA library function

type CudaError

type CudaError struct {
	ErrCode int
	ErrName string
	ErrMsg  string
}

CudaError implments error interface and records CUDA error info.

func (*CudaError) Error

func (e *CudaError) Error() string

Error CudaError implments error interface.

type CudaFuncCache

type CudaFuncCache int

CudaFuncCache - CUDA library enum type cudaFuncCache

type CudaLimit

type CudaLimit int

CudaLimit - CUDA library enum type cudaLimit

Directories

Path Synopsis
package windows implements Cuda C Runtime library to Go.
package windows implements Cuda C Runtime library to Go.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL