CuBlas & CULA for Delphi 7 Matrix/Vector Classes for Dense Linear Algebra
The File Atteched Has The Units To Work With Delphi 7.0

Visual Example
CULACuBlasMtxVec
CULA (interface unit)
CuBlas (Interface Unit)

Tested with
Delphi 7.0
Cuda ToolKit 4
Cula Premim R12
devdriver_4.0_winxp_32_270.81_general
PNY NVIDIA Quadro VCQ 4000 Professional Graphics Card VCQ4000-PB

Some of the Copy Functions doesn't work, so don't use them.

Any Ideas To Improvet It are Welcome
The File Atteched Has The Units To Work With Delphi 7.0



Visual Example

CULACuBlasMtxVec

CULA (interface unit)

CuBlas (Interface Unit)



Tested with

Delphi 7.0

Cuda ToolKit 4

Cula Premim R12

devdriver_4.0_winxp_32_270.81_general

PNY NVIDIA Quadro VCQ 4000 Professional Graphics Card VCQ4000-PB



Some of the Copy Functions doesn't work, so don't use them.



Any Ideas To Improvet It are Welcome

#1
Posted 07/10/2011 05:17 PM   
Now I have code BicgStab using Cublas in Delphi 7.0

I use the same example to run it with culaDgesv(Cula) and BicgStab(cublas).

The next week I will work with GMRES.

It was tested with Quadro 4000 and GTX 450.
Now I have code BicgStab using Cublas in Delphi 7.0



I use the same example to run it with culaDgesv(Cula) and BicgStab(cublas).



The next week I will work with GMRES.



It was tested with Quadro 4000 and GTX 450.

#2
Posted 07/16/2011 12:05 AM   
Here is the interface unit for [b]CuBlas[/b] (double & single) and [b]Cuda[/b] (just some functions) in [b]Cuda 4.0 Version[/b], the older files that I have in my Forum are not 4.0.
The Zipped File includes the [b]CuBlasMtxVec Classes [/b](Vector & Matrix) using only CuBlas functions, the solvers are CG and BiCGStab, GMRES is pending, sorry, I will work on it, but first I had to create the CuBlas interface unit for [b]Cuda 4.0[/b] in [b]Delphi 7.0[/b].

...the file also includes:
cublas_api.pas
cudaRT_v2.pas
cublas.pas
and an example

and PDF files from where I took the information or code for CG and BiCGStab.
Here is the interface unit for CuBlas (double & single) and Cuda (just some functions) in Cuda 4.0 Version, the older files that I have in my Forum are not 4.0.

The Zipped File includes the CuBlasMtxVec Classes (Vector & Matrix) using only CuBlas functions, the solvers are CG and BiCGStab, GMRES is pending, sorry, I will work on it, but first I had to create the CuBlas interface unit for Cuda 4.0 in Delphi 7.0.



...the file also includes:

cublas_api.pas

cudaRT_v2.pas

cublas.pas

and an example



and PDF files from where I took the information or code for CG and BiCGStab.

#3
Posted 11/11/2011 10:48 PM   
[twitter]Tavo_Nice[/twitter] Finally here is [b]GMRES[/b] in [b]CuBlas V2 Cuda 4[/b] for [b]Delphi[/b] with Cuda RunTime, CuBlas and Cublas API unit interfaces...
I have included the [b]Standard LU Decomposition [/b]and [b]Block LU Decomposition[/b], but without examples.
[twitter]Tavo_Nice[/twitter] Finally here is GMRES in CuBlas V2 Cuda 4 for Delphi with Cuda RunTime, CuBlas and Cublas API unit interfaces...

I have included the Standard LU Decomposition and Block LU Decomposition, but without examples.
Attachments

GMRES_CuBLAS.zip

#4
Posted 11/21/2011 02:26 AM   
GMRES with Reorthogonalization method, just change reorth:=1; to reorth:=0; if you want it or not

The Solution of the Triangular System is made with Cublas too.

Code:

[b]for[/b] col:= 0 [b]to[/b] ii-1 [b]do[/b] cudaMemcpy(@h_device[col*ii], @H[col*(m+1)],ii*sizeof(double),cudaMemcpyHostToDevice);

statuscublas:= cublasSetVector(ii, sizeof(double),@s[0],1,@y[0],1);

cublasDtrsv(' ',' ',' ',(ii), h_device[0], (ii), y[0], 1);

cublasDgemv('N', N, (ii), 1.0, V[0], N, y[0], 1, 1.0, xx[0] , 1);
GMRES with Reorthogonalization method, just change reorth:=1; to reorth:=0; if you want it or not



The Solution of the Triangular System is made with Cublas too.



Code:



for col:= 0 to ii-1 do cudaMemcpy(@h_device[col*ii], @H[col*(m+1)],ii*sizeof(double),cudaMemcpyHostToDevice);



statuscublas:= cublasSetVector(ii, sizeof(double),@s[0],1,@y[0],1);



cublasDtrsv(' ',' ',' ',(ii), h_device[0], (ii), y[0], 1);



cublasDgemv('N', N, (ii), 1.0, V[0], N, y[0], 1, 1.0, xx[0] , 1);
Attachments

GMRES_CuBLAS.zip

#5
Posted 11/21/2011 02:35 AM   
Now I have included the Simpler GMRES with Modified Gram Schmidt in the future I will include its Householder version.

Cublas V2
Cuda 4.0

[b]Object Oriented Dense Linear Algebra for Nvidia GPU's with Delphi 7.0[/b]

Conjugate Gradient [b]CG[/b]
BiConjugate Gradient Stabilizated [b]BiCGStab[/b]
Generalized Minimal Residual with Modified Gram Schmidt [b]GMRES[/b]
Simpler Generalized Minimal Residual with Modified Gram Schmidt [b]SGMRES[/b]
Adaptive Simpler Generalized Minimal Residual with Modified Gram Schmidt [b]AdaptiveSGMRES[/b]
Now I have included the Simpler GMRES with Modified Gram Schmidt in the future I will include its Householder version.



Cublas V2

Cuda 4.0



Object Oriented Dense Linear Algebra for Nvidia GPU's with Delphi 7.0



Conjugate Gradient CG

BiConjugate Gradient Stabilizated BiCGStab

Generalized Minimal Residual with Modified Gram Schmidt GMRES

Simpler Generalized Minimal Residual with Modified Gram Schmidt SGMRES

Adaptive Simpler Generalized Minimal Residual with Modified Gram Schmidt AdaptiveSGMRES
Attachments

GMRES_CuBLAS.zip

#6
Posted 11/24/2011 01:29 AM   
Here is the whole idea of creating Object Oriented Dense Linear Algebra with Iterative Solvers

Object Oriented Linear Circuit Simulator using Object Oriented Dense Linear Algebra (Cublas Wrapper for Delphi 7.0)

example (included):

TCircuitProblem = [b]Class[/b](TCircuit)
[b]public[/b]
VDC1, VDC2: TDCVSource;
IDC1: TDCISource;
R1, R2, R3: TResistor;
[b]constructor[/b] Create;
[b]end;[/b]
.
.
.
{ TCircuitProblem }

[b]constructor[/b] TCircuitProblem.Create;
[b]begin[/b]
[b]inherited[/b] Create;
VDC1:= TDCVSource.Create(1,0,4.5);
VDC2:= TDCVSource.Create(3,0,4.5);
IDC1:= TDCISource.Create(2,0,2.0);
R1:= TResistor.Create(1,2,4.0);
R2:= TResistor.Create(2,3,4.0);
R3:= TResistor.Create(2,0,3.0);
Add(VDC1);
Add(VDC2);
Add(IDC1);
Add(R1);
Add(R2);
Add(R3);
[b]end;[/b]

DC Analysis:
CircuitProblem.DCAnalysis //the solver is LU Decomposition Totally Implemented with CuBLAS

in the furure I will make the NonLinear...
Here is the whole idea of creating Object Oriented Dense Linear Algebra with Iterative Solvers



Object Oriented Linear Circuit Simulator using Object Oriented Dense Linear Algebra (Cublas Wrapper for Delphi 7.0)



example (included):



TCircuitProblem = Class(TCircuit)

public

VDC1, VDC2: TDCVSource;

IDC1: TDCISource;

R1, R2, R3: TResistor;

constructor Create;

end;

.

.

.

{ TCircuitProblem }



constructor TCircuitProblem.Create;

begin

inherited Create;

VDC1:= TDCVSource.Create(1,0,4.5);

VDC2:= TDCVSource.Create(3,0,4.5);

IDC1:= TDCISource.Create(2,0,2.0);

R1:= TResistor.Create(1,2,4.0);

R2:= TResistor.Create(2,3,4.0);

R3:= TResistor.Create(2,0,3.0);

Add(VDC1);

Add(VDC2);

Add(IDC1);

Add(R1);

Add(R2);

Add(R3);

end;



DC Analysis:

CircuitProblem.DCAnalysis //the solver is LU Decomposition Totally Implemented with CuBLAS



in the furure I will make the NonLinear...

#7
Posted 11/27/2011 12:49 AM   
[b]Object Oriented Dense Linear Algebra for Nvidia GPU's with Delphi 7.0 using CuBLAS[/b]

[b]Direct Solvers:[/b]
LU Decomposition Solver [b]LUSolve[/b]
Gauss Elimination Solver [b]GaussSolve[/b]

[b]Iterative Solvers:[/b]
Conjugate Gradient [b]CG[/b]
BiConjugate Gradient Stabilizated [b]BiCGStab[/b]
Generalized Minimal Residual with Modified Gram Schmidt [b]GMRES[/b]
Simpler Generalized Minimal Residual with Modified Gram Schmidt [b]SGMRES[/b]
Adaptive Simpler Generalized Minimal Residual with Modified Gram Schmidt [b]AdaptiveSGMRES[/b]

[b]Plus:[/b]
Add, Sub, Prod, NormL2, Dot functions using CuBLAS. CUDA 4.0.

[b]Examples:[/b]
Linear Algebra & Linear Circuit Simulator (DC Analysis)

code c, c++, cpp, h, pascal
Object Oriented Dense Linear Algebra for Nvidia GPU's with Delphi 7.0 using CuBLAS



Direct Solvers:

LU Decomposition Solver LUSolve

Gauss Elimination Solver GaussSolve



Iterative Solvers:

Conjugate Gradient CG

BiConjugate Gradient Stabilizated BiCGStab

Generalized Minimal Residual with Modified Gram Schmidt GMRES

Simpler Generalized Minimal Residual with Modified Gram Schmidt SGMRES

Adaptive Simpler Generalized Minimal Residual with Modified Gram Schmidt AdaptiveSGMRES



Plus:

Add, Sub, Prod, NormL2, Dot functions using CuBLAS. CUDA 4.0.



Examples:

Linear Algebra & Linear Circuit Simulator (DC Analysis)



code c, c++, cpp, h, pascal

#8
Posted 12/06/2011 06:04 AM   
[b]Linear & NonLinear Electronic Circuit Simulator[/b]

DAE Solver (Differential Algebraic Equations) with CUBLAS in Delphi 7.0 (Object Pascal)
& CuBLAS Dense Linear Algebra Matrix Vector Classes with Direct and Krylov Methods

The Circuit Analysis Technique is Modified Nodal Analysis.

Transient and DC Analysis (Damped Newton Method)

Examples:

Rectifier Bridge with RC Filter Load

Rectifier Bridge with DC Linear Voltage Regulator and RC Filter Load

both with options to run Half Wave, Full Wave and to adjust RL, CL, Freq and Vi AC Volts.

Integration Methods include BE (Backward Euler), TR (Trapezoidal), BDF2 (Backwad Differentiation Formula 2nd or Gear 2nd Method) and TRBDF2

with automatic step size and order control.
Linear & NonLinear Electronic Circuit Simulator



DAE Solver (Differential Algebraic Equations) with CUBLAS in Delphi 7.0 (Object Pascal)

& CuBLAS Dense Linear Algebra Matrix Vector Classes with Direct and Krylov Methods



The Circuit Analysis Technique is Modified Nodal Analysis.



Transient and DC Analysis (Damped Newton Method)



Examples:



Rectifier Bridge with RC Filter Load



Rectifier Bridge with DC Linear Voltage Regulator and RC Filter Load



both with options to run Half Wave, Full Wave and to adjust RL, CL, Freq and Vi AC Volts.



Integration Methods include BE (Backward Euler), TR (Trapezoidal), BDF2 (Backwad Differentiation Formula 2nd or Gear 2nd Method) and TRBDF2



with automatic step size and order control.

#9
Posted 12/12/2011 12:25 AM   
Scroll To Top