Skip to content

storage #

VulkanParams defines a public data structure for this module.

Constants #

const vector_minimum_capacity = 2

vector_minimum_capacity is a public constant used by this module.

const vector_growth_factor = 2

vector_growth_factor is a public constant used by this module.

const vector_shrink_threshold = 1.0 / 4.0

vector_shrink_threshold is a public constant used by this module.

fn from_array #

fn from_array[T](arr []T) &CpuStorage[T]

from_array exposes this operation as part of the public API.

fn storage #

fn storage[T](len int, cap int, init T) &CpuStorage[T]

storage exposes this operation as part of the public API.

fn (CpuStorage[T]) clone #

fn (s &CpuStorage[T]) clone[T]() &CpuStorage[T]

clone exposes this operation as part of the public API.

fn (CpuStorage[T]) cuda #

fn (cpu &CpuStorage[T]) cuda(params CudaParams) !&CpuStorage[T]

cuda returns an error when CUDA is not enabled at compile time

fn (CpuStorage[T]) fill #

fn (mut s CpuStorage[T]) fill[T](val T)

fill fills an entire storage with a given value

fn (CpuStorage[T]) get #

fn (s &CpuStorage[T]) get[T](i int) T

get exposes this operation as part of the public API.

fn (CpuStorage[T]) like #

fn (s &CpuStorage[T]) like[T]() &CpuStorage[T]

like exposes this operation as part of the public API.

fn (CpuStorage[T]) like_with_len #

fn (s &CpuStorage[T]) like_with_len[T](len int) &CpuStorage[T]

like_with_len exposes this operation as part of the public API.

fn (CpuStorage[T]) offset #

fn (s &CpuStorage[T]) offset[T](start int) &CpuStorage[T]

offset exposes this operation as part of the public API.

fn (CpuStorage[T]) set #

fn (mut s CpuStorage[T]) set[T](i int, val T)

set exposes this operation as part of the public API.

fn (CpuStorage[T]) to_array #

fn (s &CpuStorage[T]) to_array[T]() []T

to_array exposes this operation as part of the public API.

fn (CpuStorage[T]) vulkan #

fn (cpu &CpuStorage[T]) vulkan(params VulkanParams) !&CpuStorage[T]

vulkan exposes this operation as part of the public API.

struct CpuStorage #

@[heap]
struct CpuStorage[T] {
pub mut:
	data []T
}

CpuStorage defines a public data structure for this module.

struct CudaParams #

@[params]
struct CudaParams {
	device_id int
	stream    voidptr = unsafe { nil }
}

struct VulkanParams #

@[params]
struct VulkanParams {}