GPULib 1.6.0 API

Tech-X Corporation

single page | use frames     summary     class     fields     routine details     file attributes

lib/

gpuvariable__define.pro


Represents a GPU variable.

Class description for gpuvariable

Inheritance

Subclasses: gpuvariableview

Properties

Properties in gpuvariable

COMPLEX init
DCOMPLEX init
DOUBLE init
ERROR init
FLOAT init
INDEX init
NOZERO init
TEMPORARY init
_data get
_handle get
_is_temporary get
dimensions get init type=lonarr(8)

size of each dimension

n_dimensions get type=long

number of dimensions: 0 - 8

n_elements get type=long

total number of elements in the variable

type get init type=long

IDL type code for variable

value init type=scalar numeric

scalar to fill in the array with

views get

Routines

Methods inherited from idl_object

Routines from gpuvariable__define.pro

result = gpuvariable_isscalar(arg)

Helper routine to determine if the one of the operands is an IDL scalar.

result = gpuvariable::_overloadPlus(left, right)

Handle adding GPU variables.

result = gpuvariable::_overloadMinus(left, right)

Handle subtracting GPU variables.

result = gpuvariable::_overloadAsterisk(left, right)

Handle multiplying GPU variables.

result = gpuvariable::_overloadSlash(left, right)

Handle dividing GPU variables.

result = gpuvariable::_overloadMOD(left, right)

Handle MOD for GPU variables.

result = gpuvariable::_overloadCaret(left, right)

Handle raising GPU variables to powers.

result = gpuvariable::_overloadPound(left, right)

Handle matrix multiplication with GPU variables.

result = gpuvariable::_overloadPoundPound(left, right)

Handle matrix multiplication with GPU variables.

result = gpuvariable::_overloadLT(left, right)

Handle LT operator for GPU variables.

result = gpuvariable::_overloadLE(left, right)

Handle LE operator for GPU variables.

result = gpuvariable::_overloadGT(left, right)

Handle GT operator for GPU variables.

result = gpuvariable::_overloadGE(left, right)

Handle GE operator for GPU variables.

result = gpuvariable::_overloadEQ(left, right)

Handle EQ operator for GPU variables.

result = gpuvariable::_overloadNE(left, right)

Handle NE operator for GPU variables.

result = gpuvariable::_overloadMinusUnary()

Handle unary minus (-) operator for GPU variables.

result = gpuvariable::_overloadLessThan(left, right)

Handle < operator for GPU variables.

result = gpuvariable::_overloadGreaterThan(left, right)

Handle > operator for GPU variables.

result = gpuvariable::_makeInd3(isRange, dims, ss1, ss2, ss3)
gpuvariable::_overloadBracketsLeftSide, objref, value, isRange, ss1, ss2, ss3, ss4, ss5, ss6, ss7, ss8

Handle assignment to slices of GPU variables.

result = gpuvariable::_overloadBracketsRightSide(isRange, ss1, ss2, ss3, ss4, ss5, ss6, ss7, ss8)

Handle indexing GPU variables.

result = gpuvariable::_overloadForeach(value, key)

Handle GPU variables in FOREACH statements.

result = gpuvariable::_overloadHelp(varname)

Overload output for HELP routine.

result = gpuvariable::_overloadPrint()

Overload output for PRINT routine.

result = gpuvariable::_overloadSize()

Overload output for SIZE routine.

gpuvariable::getProperty, type=long, n_elements=long, n_dimensions=long, dimensions=lonarr(8), views=views, _is_temporary=_is_temporary, _handle=_handle, _data=_data

Get properties of the variable.

result = gpuvariable::getType()

Returns the SIZE type code for the data type for the GPU variable.

gpuvariable::_setType, type
result = gpuvariable::getNElements()
gpuvariable::_setNElements, n_elements
result = gpuvariable::getNDimensions()
gpuvariable::_setNDimensions, n_dimensions
result = gpuvariable::getDimensions()
gpuvariable::_setDimensions, dimensions
result = gpuvariable::_getData()

Returns data in an IDL emulation GPU variable.

result = gpuvariable::_getDataPtr()

Returns pointer to data in an IDL emulation GPU variable.

gpuvariable::_setData, data [, XOFFSET=long] [, XWIDTH=long] [, YOFFSET=long] [, YWIDTH=long] [, OFFSETS=lonarr(1-8)] [, WIDTHS=lonarr(1-8)] [, INDICES=lonarr]

Sets the data, or a portion of the data, stored as a regular IDL variable when using pure IDL emulation.

result = gpuvariable::_getHandle()
gpuvariable::_setHandle, handle
result = gpuvariable::_isTemporary()
gpuvariable::_setTemporary, temporary
gpuvariable::putarr, value, ERROR=ERROR, CPU=CPU, STREAM=STREAM
result = gpuvariable::getarr(LHS=LHS, ERROR=ERROR, CPU=CPU, STREAM=STREAM)
result = gpuvariable::_createView(offset, nelements, error=error)

Create a view of this GPU variable.

gpuvariable::_allocate, INDEX=INDEX, NOZERO=NOZERO, VALUE=VALUE, ERROR=ERROR

Allocate the variable on the GPU (or in heap memory if using pure IDL emulation).

gpuvariable::_free
gpuvariable::cleanup

Free GPU variable resources.

result = gpuvariable::init(TYPE=long, DIMENSIONS=lonarr(8), FLOAT=FLOAT, DOUBLE=DOUBLE, COMPLEX=COMPLEX, DCOMPLEX=DCOMPLEX, INDEX=INDEX, NOZERO=NOZERO, VALUE=scalar numeric, ERROR=ERROR, TEMPORARY=TEMPORARY)

Create a GPUVariable object.

gpuvariable__define

Define GPU variable's fields.

Routine details

top gpuvariable_isscalar

result = gpuvariable_isscalar(arg)

Helper routine to determine if the one of the operands is an IDL scalar.

Return value

1 if arg is a scalar, 0 if not

Parameters

arg in required type=any

operand to determine if it is a IDL scalar

top gpuvariable::_overloadPlus

result = gpuvariable::_overloadPlus(left, right)

Handle adding GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of + operator

right in required type=GPUVariable object or numeric array

right side of + operator

top gpuvariable::_overloadMinus

result = gpuvariable::_overloadMinus(left, right)

Handle subtracting GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of - operator

right in required type=GPUVariable object or numeric array

right side of - operator

top gpuvariable::_overloadAsterisk

result = gpuvariable::_overloadAsterisk(left, right)

Handle multiplying GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of * operator

right in required type=GPUVariable object or numeric array

right side of * operator

top gpuvariable::_overloadSlash

result = gpuvariable::_overloadSlash(left, right)

Handle dividing GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of / operator

right in required type=GPUVariable object or numeric array

right side of / operator

top gpuvariable::_overloadMOD

result = gpuvariable::_overloadMOD(left, right)

Handle MOD for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of MOD operator

right in required type=GPUVariable object or numeric array

right side of MOD operator

top gpuvariable::_overloadCaret

result = gpuvariable::_overloadCaret(left, right)

Handle raising GPU variables to powers.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of ^ operator

right in required type=GPUVariable object or numeric array

right side of ^ operator

top gpuvariable::_overloadPound

result = gpuvariable::_overloadPound(left, right)

Handle matrix multiplication with GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of # operator

right in required type=GPUVariable object or numeric array

right side of # operator

top gpuvariable::_overloadPoundPound

result = gpuvariable::_overloadPoundPound(left, right)

Handle matrix multiplication with GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of ## operator

right in required type=GPUVariable object or numeric array

right side of ## operator

top gpuvariable::_overloadLT

result = gpuvariable::_overloadLT(left, right)

Handle LT operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of LT operator

right in required type=GPUVariable object or numeric array

right side of LT operator

top gpuvariable::_overloadLE

result = gpuvariable::_overloadLE(left, right)

Handle LE operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of LE operator

right in required type=GPUVariable object or numeric array

right side of LE operator

top gpuvariable::_overloadGT

result = gpuvariable::_overloadGT(left, right)

Handle GT operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of GT operator

right in required type=GPUVariable object or numeric array

right side of GT operator

top gpuvariable::_overloadGE

result = gpuvariable::_overloadGE(left, right)

Handle GE operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of GE operator

right in required type=GPUVariable object or numeric array

right side of GE operator

top gpuvariable::_overloadEQ

result = gpuvariable::_overloadEQ(left, right)

Handle EQ operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of EQ operator

right in required type=GPUVariable object or numeric array

right side of EQ operator

top gpuvariable::_overloadNE

result = gpuvariable::_overloadNE(left, right)

Handle NE operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of NE operator

right in required type=GPUVariable object or numeric array

right side of NE operator

top gpuvariable::_overloadMinusUnary

result = gpuvariable::_overloadMinusUnary()

Handle unary minus (-) operator for GPU variables.

Return value

GPU variable object

top gpuvariable::_overloadLessThan

result = gpuvariable::_overloadLessThan(left, right)

Handle < operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of < operator

right in required type=GPUVariable object or numeric array

right side of < operator

top gpuvariable::_overloadGreaterThan

result = gpuvariable::_overloadGreaterThan(left, right)

Handle > operator for GPU variables.

Return value

GPU variable object

Parameters

left in required type=GPUVariable object or numeric array

left side of > operator

right in required type=GPUVariable object or numeric array

right side of > operator

top gpuvariable::_makeInd3

result = gpuvariable::_makeInd3(isRange, dims, ss1, ss2, ss3)

Parameters

isRange
dims
ss1
ss2
ss3

top gpuvariable::_overloadBracketsLeftSide

gpuvariable::_overloadBracketsLeftSide, objref, value, isRange, ss1, ss2, ss3, ss4, ss5, ss6, ss7, ss8

Handle assignment to slices of GPU variables.

Parameters

objref in required type=object

equivalent to self

value in required type=any

right-hande side of an assignment

isRange in required type=bytarr

boolean array indicating whether the corresponding ssi argument is a 3-element range or a list of indices

ss1
ss2
ss3
ss4
ss5
ss6
ss7
ss8

top gpuvariable::_overloadBracketsRightSide

result = gpuvariable::_overloadBracketsRightSide(isRange, ss1, ss2, ss3, ss4, ss5, ss6, ss7, ss8)

Handle indexing GPU variables.

Return value

GPU variable object

Parameters

isRange in required type=bytarr

boolean array indicating whether the corresponding ssi argument is a 3-element range or a list of indices

ss1
ss2
ss3
ss4
ss5
ss6
ss7
ss8

Other attributes

Todo:

handle negative subscripts

top gpuvariable::_overloadForeach

result = gpuvariable::_overloadForeach(value, key)

Handle GPU variables in FOREACH statements. For 1-dimensional arrays, each iteration will yield a view of a single element array. For 2-dimensional arrays, each iteration will yield a view of a row of the array. The key for each is a long integer index, either the element index in the 1-dimensional case or the row index in the 2-dimensional case.

Return value

1 if there is a current element to retrieve, 0 if not

Parameters

value in required type=scalar numeric

return value for the iteration

key in required type=undefined or long

undefined on initial item and row index for subsequent calls

top gpuvariable::_overloadHelp

result = gpuvariable::_overloadHelp(varname)

Overload output for HELP routine.

Parameters

varname in required type=string

variable name

top gpuvariable::_overloadPrint

result = gpuvariable::_overloadPrint()

Overload output for PRINT routine.

top gpuvariable::_overloadSize

result = gpuvariable::_overloadSize()

Overload output for SIZE routine.

top gpuvariable::getProperty

gpuvariable::getProperty, type=long, n_elements=long, n_dimensions=long, dimensions=lonarr(8), views=views, _is_temporary=_is_temporary, _handle=_handle, _data=_data

Get properties of the variable.

Keywords

type type=long

IDL type code for variable

n_elements type=long

total number of elements in the variable

n_dimensions type=long

number of dimensions: 0 - 8

dimensions type=lonarr(8)

size of each dimension

views
_is_temporary
_handle
_data

top gpuvariable::getType

result = gpuvariable::getType()

Returns the SIZE type code for the data type for the GPU variable.

Return value

SIZE type code

top gpuvariable::_setType

gpuvariable::_setType, type

Parameters

type

top gpuvariable::getNElements

result = gpuvariable::getNElements()

top gpuvariable::_setNElements

gpuvariable::_setNElements, n_elements

Parameters

n_elements

top gpuvariable::getNDimensions

result = gpuvariable::getNDimensions()

top gpuvariable::_setNDimensions

gpuvariable::_setNDimensions, n_dimensions

Parameters

n_dimensions

top gpuvariable::getDimensions

result = gpuvariable::getDimensions()

top gpuvariable::_setDimensions

gpuvariable::_setDimensions, dimensions

Parameters

dimensions

top gpuvariable::_getData

result = gpuvariable::_getData()

Returns data in an IDL emulation GPU variable.

Return value

IDL data array

top gpuvariable::_getDataPtr

result = gpuvariable::_getDataPtr()

Returns pointer to data in an IDL emulation GPU variable.

Return value

IDL pointer to data array

top gpuvariable::_setData

gpuvariable::_setData, data [, XOFFSET=long] [, XWIDTH=long] [, YOFFSET=long] [, YWIDTH=long] [, OFFSETS=lonarr(1-8)] [, WIDTHS=lonarr(1-8)] [, INDICES=lonarr]

Sets the data, or a portion of the data, stored as a regular IDL variable when using pure IDL emulation.

Parameters

data in required type=numeric array

data, or subset of data, to place in the GPU variable

Keywords

XOFFSET in optional type=long
XWIDTH in optional type=long
YOFFSET in optional type=long
YWIDTH in optional type=long
OFFSETS in optional type=lonarr(1-8)
WIDTHS in optional type=lonarr(1-8)
INDICES in optional type=lonarr

top gpuvariable::_getHandle

result = gpuvariable::_getHandle()

top gpuvariable::_setHandle

gpuvariable::_setHandle, handle

Parameters

handle

top gpuvariable::_isTemporary

result = gpuvariable::_isTemporary()

top gpuvariable::_setTemporary

gpuvariable::_setTemporary, temporary

Parameters

temporary

top gpuvariable::putarr

gpuvariable::putarr, value, ERROR=ERROR, CPU=CPU, STREAM=STREAM

Parameters

value

Keywords

ERROR
CPU
STREAM

top gpuvariable::getarr

result = gpuvariable::getarr(LHS=LHS, ERROR=ERROR, CPU=CPU, STREAM=STREAM)

Keywords

LHS
ERROR
CPU
STREAM

top gpuvariable::_createView

result = gpuvariable::_createView(offset, nelements, error=error)

Create a view of this GPU variable.

Return value

GPU variable view

Parameters

offset in required type=long

array element of origin of view

nelements in required type=long

number of elements in the view

Keywords

error

top gpuvariable::_allocate

gpuvariable::_allocate, INDEX=INDEX, NOZERO=NOZERO, VALUE=VALUE, ERROR=ERROR

Allocate the variable on the GPU (or in heap memory if using pure IDL emulation).

Keywords

INDEX
NOZERO
VALUE
ERROR

top gpuvariable::_free

gpuvariable::_free

top gpuvariable::cleanup

gpuvariable::cleanup

Free GPU variable resources.

top gpuvariable::init

result = gpuvariable::init(TYPE=long, DIMENSIONS=lonarr(8), FLOAT=FLOAT, DOUBLE=DOUBLE, COMPLEX=COMPLEX, DCOMPLEX=DCOMPLEX, INDEX=INDEX, NOZERO=NOZERO, VALUE=scalar numeric, ERROR=ERROR, TEMPORARY=TEMPORARY)

Create a GPUVariable object.

Return value

1 if successfully initialized, 0 if not

Keywords

TYPE type=long

IDL type code for variable

DIMENSIONS type=lonarr(8)

size of each dimension

FLOAT
DOUBLE
COMPLEX
DCOMPLEX
INDEX
NOZERO
VALUE type=scalar numeric

scalar to fill in the array with

ERROR
TEMPORARY

top gpuvariable__define

gpuvariable__define

Define GPU variable's fields.

File attributes

Modification date: Wed May 15 13:02:37 2013
Lines: 1,193
Docformat: rst rst

GPULib and related documentation copyright 2007-2012, Tech-X Corporation, Boulder, CO. Tech-X, is a registered trademark of Tech-X Corporation. GPULib is a trademark of Tech-X Corporation. All other company, product and brand names are the property of their respective owners.