You are here: Symbol Reference > Dew Namespace > Dew.Math Namespace > Classes > clVector Structure
Dew Math for .NET
ContentsIndexHome
PreviousUpNext
clVector Structure

Open CL vector class with overloaded operators.

Syntax
C#
Visual Basic
public struct clVector { }

clMtxExpr.cs

Declare clVector to run computation on Open CL Be carefull to declare clVector only for local variables with short lifetime. Call the Create method for clVector, if the variable is a global variable or a variable with a longer life.If the Create method (constuctor) is called, the clVector creates its own memory object in GPU memory, otherwise object cache is used.

var b, c: clVector; bv: TSingleArray; begin b := clVector(TDoubleArray.Create(1,1,1,1)); b = [1,1,1,1]; b.Scale(2); c := b*2 + Cplx(2,3); c := b*2 + 2 + 3i b.Add(c); b.CopyToArray(bv); //copy data back to host from GPU end;
Copyright (c) 1999-2024 by Dew Research. All rights reserved.
What do you think about this topic? Send feedback!