Skip to content
JuliaGPUPublic

About

An interface for using NVIDIA's AMGX library from the Julia language.

Topics

Resources

Stars

21 stars

Watchers

6 watching

Forks

Latest commit

 

History

83 Commits

Folders and files

Repository files navigation

AMGX.jl

AMGX in Julia

Documentation Build Status

The AMGX.jl package provides an interface for using NVIDIA's AMGX library from the Julia language.

Installation

using Pkg; Pkg.add("AMGX")

Prebuilt binaries are available for Linux. On other systems you need a local AMGX build; point JULIA_AMGX_PATH at the shared library before loading the package.

Quick start

using AMGX, CUDA, SparseArrays

AMGX.initialize()

config    = AMGX.Config(Dict("monitor_residual" => 1, "max_iters" => 100))
resources = AMGX.Resources(config)

A = sparse([1,1,2,2,3,3], [1,2,2,3,1,3], [4.0,1.0,4.0,1.0,1.0,4.0], 3, 3)

matrix = AMGX.AMGXMatrix(resources, AMGX.dDDI)
AMGX.upload!(matrix, CUDA.CUSPARSE.CuSparseMatrixCSR(A))

rhs = AMGX.AMGXVector(resources, AMGX.dDDI)
AMGX.upload!(rhs, [1.0, 2.0, 3.0])

x = AMGX.AMGXVector(resources, AMGX.dDDI)
AMGX.set_zero!(x, 3)

solver = AMGX.Solver(resources, AMGX.dDDI, config)
AMGX.setup!(solver, matrix)
AMGX.solve!(x, solver, rhs)

@show AMGX.get_status(solver)
@show Vector(x)

AMGX.finalize()

AMGX objects are released by the garbage collector, or earlier with close — see Memory management. Note that a solve which does not converge is not an error, so get_status should always be checked.

Documentation

Full documentation is at juliagpu.github.io/AMGX.jl, covering configuration, vectors and matrices, solving, memory management, the utility functions, and the complete API reference.

Reading the official AMGX reference manual is also recommended — the configuration parameters are AMGX's own.

About

An interface for using NVIDIA's AMGX library from the Julia language.

Topics

Resources

Stars

21 stars

Watchers

6 watching

Forks

Releases

Used by

Contributors

Languages