cudnn

package
v0.0.0-...-98db5b7 Latest Latest
Warning

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

Go to latest
Published: May 7, 2020 License: CC-BY-4.0 Imports: 12 Imported by: 26

Documentation

Overview

Package cudnn takes the descriptors from gocudnn which is from cudnn and seperates them into seperate packages. In the hopes to eventually move away from all those pesky flags. Some flags will have to exist still, but where I can get rid of them I will. Like DataType and NanProp and TensorFormat, and even algorithm for convolution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToImagesColorFloat32

func ToImagesColorFloat32(data []float32, dims []int32, frmt gocudnn.TensorFormat) ([][]image.Image, error)

ToImagesColorFloat32 changes data passed to a bunch of images

Types

type Handler

type Handler struct {
	*gocu.Worker
	// contains filtered or unexported fields
}

Handler contains the handles used in gocudnn and also the xtra kernals.

func CreateHandler

func CreateHandler(w *gocu.Worker, dev cudart.Device, seed uint64) (h *Handler)

CreateHandler creates a the handlers The handler is used in managing memory for all the packages that use cudnn.Handler. This function will raise a flag that will tell the program to use unified memory management. If that is not wanted call MakeNotUnified immediately to turn this off.

func (*Handler) Cudnn

func (h *Handler) Cudnn() *gocudnn.Handle

Cudnn returns a pointer to the cudnn handle

func (*Handler) DeviceSync

func (h *Handler) DeviceSync() error

DeviceSync syncs the device

func (*Handler) FindVol

func (h *Handler) FindVol(outputdims []int32) int32

FindVol will find the max vol for tensor. This is going to hold two functions pmax can be either the previous maxvol, or it could be

func (*Handler) GetCuRNG

func (h *Handler) GetCuRNG() *curand.Generator

GetCuRNG returns the curand.Generator Handler is holding

func (*Handler) MakeNotUnified

func (h *Handler) MakeNotUnified()

MakeNotUnified sets unified flag for device the handler is using to false.

func (*Handler) SetDevice

func (h *Handler) SetDevice() error

SetDevice sets the device the handler is using

func (*Handler) SetStream

func (h *Handler) SetStream(stream gocu.Streamer) error

SetStream sets the stream for the handles

func (*Handler) Stream

func (h *Handler) Stream() gocu.Streamer

Stream returns the stream

func (*Handler) Sync

func (h *Handler) Sync() error

Sync syncs the streams

func (*Handler) SyncContext

func (h *Handler) SyncContext() error

SyncContext will sync the contexts

func (*Handler) Unified

func (h *Handler) Unified() bool

Unified returns if the device the handler is using uses unified memory

func (*Handler) XHandle

func (h *Handler) XHandle() *xtra.Handle

XHandle returns a pointer to the XHandle

type TrainMode

type TrainMode xtra.TrainingMode

TrainMode is a flag to set the TrainingMode

func (TrainMode) Cu

func (t TrainMode) Cu() xtra.TrainingMode

Cu is used to pass gocudnn.TrainMode flags for the functions inside the different cudnn packages

type TrainModeFlag

type TrainModeFlag struct {
	// contains filtered or unexported fields
}

TrainModeFlag is used to pass TrainingMode flags through methods.

func (TrainModeFlag) AdaDelta

func (t TrainModeFlag) AdaDelta() TrainMode

AdaDelta is used to set the TrainingMode to AdaDelta

func (TrainModeFlag) AdaGrad

func (t TrainModeFlag) AdaGrad() TrainMode

AdaGrad is used to set the TrainingMode to AdaGrad

func (TrainModeFlag) Adam

func (t TrainModeFlag) Adam() TrainMode

Adam is used to set the TrainingMode to Adam

Directories

Path Synopsis
Package softmax uses the softmax functions from gocudnn which is from cudnn.
Package softmax uses the softmax functions from gocudnn which is from cudnn.
Package tensor is used to make tensors by using gocudnn.
Package tensor is used to make tensors by using gocudnn.

Jump to

Keyboard shortcuts

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