Giter Site home page Giter Site logo

clblas.jl's Introduction

CLBLAS.jl

Build status:

AMD clBLAS bindings for Julia.

Installation notes

if the download of the binary fails on linux, you may also try to install clblas with sudo apt-get install libclblas-dev and then rerun Pkg.build("CLBLAS").

Current status

  • Low-level bindings
  • Partial implementation of high-level API similar to Base.LinAlg.BLAS

Example

using OpenCL
import OpenCL.cl.CLArray
import CLBLAS
const clblas = CLBLAS


clblas.setup()
device, ctx, queue = clblas.get_next_compute_context()
alpha = 1.0
beta = 0.0

hA = rand(5, 10)
hB = rand(10, 5)
A = CLArray(queue, hA)
B = CLArray(queue, hB)
C = cl.zeros(queue, 5, 5)

clblas.gemm!('N', 'N', alpha, A, B, beta, C)
hC = cl.to_host(C)
if isapprox(hC, hA * hB)
    info("Success!")
else
    error("Results diverged")
end

Caveats

  • Complex64/CL_float2 doesn't work by default. This is caused by some weird incompatibility between clang (default for Julia) and gcc (default for clBLAS), so the only way to fix it right now is to manually compile clBLAS using clang,

clblas.jl's People

Contributors

dfdx avatar dlfivefifty avatar ekobir avatar femtocleaner[bot] avatar ggggggggg avatar jakebolewski avatar juliohm avatar maleadt avatar musm avatar nstiurca avatar ranocha avatar simondanisch avatar tkelman avatar vchuravy avatar yeison avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clblas.jl's Issues

Unable to use Dgemm

I'm trying to use GEMM with double-precision floats, but that doesn't seem supported? I tried a straight-forward adaptation of the clblasSgemm_future.jl and clblasSgemmRandomBufferFuture.jl examples to use Float64/cl.cl_double, but I get the following errors.

$ julia clblasDgemm_future.jl
WARNING: float64(x::AbstractArray) is deprecated, use map(Float64,x) instead.
 in depwarn at deprecated.jl:73
 in float64 at deprecated.jl:50
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemm_future.jl, in expression starting on line 9
WARNING: float64(x::AbstractArray) is deprecated, use map(Float64,x) instead.
 in depwarn at deprecated.jl:73
 in float64 at deprecated.jl:50
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemm_future.jl, in expression starting on line 10
ERROR: LoadError: MethodError: `clblasDgemm` has no method matching clblasDgemm(::UInt32, ::UInt32, ::Float64, ::Array{Float64,2}, ::Array{Float64,2}, ::Float64, ::Array{Float64,2})
Closest candidates are:
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1}, !Matched::Union{Array{Ptr{Void},1},Void})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any)
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemm_future.jl, in expression starting on line 15

and

$ julia clblasDgemmRandomBufferFuture.jl
ERROR: LoadError: MethodError: `clblasDgemm` has no method matching clblasDgemm(::UInt32, ::UInt32, ::Float64, ::OpenCL.Buffer{Float64}, ::OpenCL.Buffer{Float64}, ::Float64, ::OpenCL.Buffer{Float64})
Closest candidates are:
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Array{OpenCL.CmdQueue,1}, !Matched::Union{Array{Ptr{Void},1},Void})
  clblasDgemm(::Any, ::Any, ::Any, ::Any, ::Any, ::Any, ::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any, !Matched::Any)
 in include at ./boot.jl:261
 in include_from_node1 at ./loading.jl:304
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /home/nstiurca/.julia/v0.4/CLBLAS/examples/clblasDgemmRandomBufferFuture.jl, in expression starting on line 26

I am using Linux Mint 17.2 (essentially Ubuntu 14.04), clBLAS v2.6, Julia v0.4, latest CLBLAS.jl master (currently 1555379).

MacOS Julia v1.0.1 no compatible versions

Currently my package manager is telling me that the only compatible version is: uninstalled (i.e. no compatible versions...)

(v1.0) pkg> add CLBLAS
Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CLBLAS [422c787a]:
CLBLAS [422c787a] log:
├─possible versions are: [0.1.0, 1.1.0-1.1.5, 1.2.0] or uninstalled
├─restricted to versions * by an explicit requirement, leaving only versions [0.1.0, 1.1.0-1.1.5, 1.2.0]
└─restricted by julia compatibility requirements to versions: uninstalled — no versions left

1.0 problem: is_windows(), is_linux, etc. need to be redefined in build.jl

It's a pretty easy fix, just replace e.g. is_windows() with Sys.iswindows().

I will open a PR to fix it fairly soon. The reason I'm not doing so immediately is because I'm not sure what should be done about macOS support.

I have a vague sense that people want to move away from Homebrew.jl, so perhaps the method for installing the dependency should be changed? I also know that Apple has controversially deprecated OpenCL support in 10.14, so perhaps it may be necessary to drop support altogether.

┌ Error: Error building `CLBLAS`: 
│ ERROR: LoadError: UndefVarError: is_windows not defined
│ Stacktrace:
│  [1] top-level scope at none:0
│  [2] include at ./boot.jl:317 [inlined]
│  [3] include_relative(::Module, ::String) at ./loading.jl:1038
│  [4] include(::Module, ::String) at ./sysimg.jl:29
│  [5] include(::String) at ./client.jl:388
│  [6] top-level scope at none:0
│ in expression starting at /Users/curry/.julia/packages/CLBLAS/U0XIf/deps/build.jl:10

ReadOnlyMemoryError() on precompile

Trying to get CLArrays working to see if it provides any gain on my Intel integrated graphics. clinfo shows both my CPU and GPU as available CL devices, so I think I have the drivers installed appropriately.

julia> using CLArrays
INFO: Recompiling stale cache file /home/sfr/.julia/lib/v0.6/CLArrays.ji for module CLArrays.

WARNING: deprecated syntax "typealias CL_float2 Complex64" at /home/sfr/.julia/v0.6/CLBLAS/src/constants.jl:4.
Use "const CL_float2 = Complex64" instead.

WARNING: deprecated syntax "typealias CL_double2 Complex128" at /home/sfr/.julia/v0.6/CLBLAS/src/constants.jl:5.
Use "const CL_double2 = Complex128" instead.
ERROR: LoadError: LoadError: InitError: ReadOnlyMemoryError()
Stacktrace:
 [1] clblasSetup() at /home/sfr/.julia/v0.6/CLBLAS/src/macros.jl:66
 [2] __init__() at /home/sfr/.julia/v0.6/CLBLAS/src/CLBLAS.jl:94
 [3] _include_from_serialized(::String) at ./loading.jl:157
 [4] _require_from_serialized(::Int64, ::Symbol, ::String, ::Bool) at ./loading.jl:200
 [5] _require(::Symbol) at ./loading.jl:464
 [6] require(::Symbol) at ./loading.jl:405
 [7] include_from_node1(::String) at ./loading.jl:576
 [8] anonymous at ./<missing>:2
during initialization of module CLBLAS
while loading /home/sfr/.julia/v0.6/CLArrays/src/3rdparty.jl, in expression starting on line 72
while loading /home/sfr/.julia/v0.6/CLArrays/src/CLArrays.jl, in expression starting on line 18
ERROR: Failed to precompile CLArrays to /home/sfr/.julia/lib/v0.6/CLArrays.ji.
Stacktrace:
 [1] compilecache(::String) at ./loading.jl:710
 [2] _require(::Symbol) at ./loading.jl:463
 [3] require(::Symbol) at ./loading.jl:405
 [4] (::##3#4)(::Atom.Progress.ProgressBar) at /home/sfr/.julia/v0.6/Atom/src/repl.jl:193
 [5] #progress#2(::String, ::String, ::Function, ::##3#4) at /home/sfr/.julia/v0.6/Atom/src/progress.jl:65
 [6] (::Atom.Progress.#kw##progress)(::Array{Any,1}, ::Atom.Progress.#progress, ::Function) at ./<missing>:0
 [7] macro expansion at ./REPL.jl:97 [inlined]
 [8] (::Base.REPL.##1#2{Base.REPL.REPLBackend})() at ./event.jl:73

Info about upcoming removal of packages in the General registry

As described in https://discourse.julialang.org/t/ann-plans-for-removing-packages-that-do-not-yet-support-1-0-from-the-general-registry/ we are planning on removing packages that do not support 1.0 from the General registry. This package has been detected to not support 1.0 and is thus slated to be removed. The removal of packages from the registry will happen approximately a month after this issue is open.

To transition to the new Pkg system using Project.toml, see https://github.com/JuliaRegistries/Registrator.jl#transitioning-from-require-to-projecttoml.
To then tag a new version of the package, see https://github.com/JuliaRegistries/Registrator.jl#via-the-github-app.

If you believe this package has erroneously been detected as not supporting 1.0 or have any other questions, don't hesitate to discuss it here or in the thread linked at the top of this post.

No proper details how to setup CLBLAS.jl

I tried using CLBLAS.jl but was getting below problems.
"error compiling setup: error compiling clblassetup: could not load module libblassetup"

On Ubuntu i was able to resolve this by building clBLAS and providing link to built library however on Windows I am still not sure.

Would be better to include these details as part for usage manual/ instructions.

Regards,
Rahul

Unable to build on Win10

julia> Pkg.build("CLBLAS")
INFO: Building CLBLAS
INFO: Attempting to Create directory C:\Users\luyao\.julia\v0.5\CLBLAS\deps\downloads
INFO: Downloading file https://github.com/clMathLibraries/clBLAS/releases/download/v2.12/clBLAS-2.12.0-Windows-x64.zip
INFO: Done downloading file https://github.com/clMathLibraries/clBLAS/releases/download/v2.12/clBLAS-2.12.0-Windows-x64.zip
INFO: Attempting to Create directory C:\Users\luyao\.julia\v0.5\CLBLAS
INFO: Directory C:\Users\luyao\.julia\v0.5\CLBLAS already created

7-Zip [64] 9.20  Copyright (c) 1999-2010 Igor Pavlov  2010-11-18

Processing archive: C:\Users\luyao\.julia\v0.5\CLBLAS\deps\downloads\clBLAS-2.12.0-Windows-x64.zip

Extracting  package
Extracting  package\bin
Extracting  package\bin\blasPerformanceTesting.py
Extracting  package\bin\clBLAS-client.exe
Extracting  package\bin\clBLAS-tune.exe
Extracting  package\bin\clBLAS.dll
Extracting  package\bin\errorHandler.py
Extracting  package\bin\make-ktest.exe
Extracting  package\bin\measurePerformance.py
Extracting  package\bin\performanceUtility.py
Extracting  package\bin\plotPerformance.py
Extracting  package\bin\test-correctness.exe
Extracting  package\bin\test-functional.exe
Extracting  package\bin\test-medium.exe
Extracting  package\bin\test-short.exe
Extracting  package\bin\testPerfWrapper.exe
Extracting  package\CMake
Extracting  package\CMake\clBLASConfig.cmake
Extracting  package\CMake\clBLASConfigVersion.cmake
Extracting  package\CMake\clBLASTargets-release.cmake
Extracting  package\CMake\clBLASTargets.cmake
Extracting  package\include
Extracting  package\include\clAmdBlas.h
Extracting  package\include\clAmdBlas.version.h
Extracting  package\include\clBLAS-complex.h
Extracting  package\include\clBLAS.h
Extracting  package\include\clBLAS.version.h
Extracting  package\lib64
Extracting  package\lib64\import
Extracting  package\lib64\import\clBLAS.lib

Everything is Ok

Folders: 6
Files: 24
Size:       34073671
Compressed: 4886063
===============================================================[ ERROR: CLBLAS ]================================================================
LoadError: Provider BinDeps.Binaries failed to satisfy dependency libCLBLAS
while loading C:\Users\luyao\.julia\v0.5\CLBLAS\deps\build.jl, in expression starting on line 44

================================================================================================================================================
================================================================[ BUILD ERRORS ]================================================================
WARNING: CLBLAS had build errors.

 - packages with build errors remain installed in C:\Users\luyao\.julia\v0.5
 - build the package(s) and all dependencies with `Pkg.build("CLBLAS")`
 - build a single package by running its `deps/build.jl` script

================================================================================================================================================

Unable to build in OS X

I have brew install clblas but get the following error. The build instruction link https://github.com/clMathLibraries/clBLAS/wiki/Build is also broken.

julia> Pkg.build("CLBLAS")
INFO: Building CLBLAS
===============================[ ERROR: CLBLAS ]================================

LoadError:     OSX not oficially supported.
    Find manual build instructions on: https://github.com/clMathLibraries/clBLAS/wiki/Build

while loading /Users/solver/.julia/v0.6/CLBLAS/deps/build.jl, in expression starting on line 38

Complex64 not working

as discussed in #21 Complex64 is currently not working and we are getting a seqfault when passing it to clblas, whereas Complex128 works without issue.

Complex64 maps to cl_float2 and Complex128 maps to cl_double2.

The definitions of both types in cl_platform.h is:

typedef union
{
    cl_float  CL_ALIGNED(8) s[2];
#if __CL_HAS_ANON_STRUCT__
   __CL_ANON_STRUCT__ struct{ cl_float  x, y; };
   __CL_ANON_STRUCT__ struct{ cl_float  s0, s1; };
   __CL_ANON_STRUCT__ struct{ cl_float  lo, hi; };
#endif
#if defined( __CL_FLOAT2__) 
    __cl_float2     v2;
#endif
}cl_float2;

typedef union
{
    cl_double  CL_ALIGNED(16) s[2];
#if __CL_HAS_ANON_STRUCT__
   __CL_ANON_STRUCT__ struct{ cl_double  x, y; };
   __CL_ANON_STRUCT__ struct{ cl_double s0, s1; };
   __CL_ANON_STRUCT__ struct{ cl_double lo, hi; };
#endif
#if defined( __CL_DOUBLE2__) 
    __cl_double2     v2;
#endif
}cl_double2;

The only difference I can see is that cl_float2 is using 8bit alignment and cl_double2 is using 16bit alignment and if I remember correctly Julia uses 16bit alignment for nearly everything.

Complex is defined here:
https://github.com/JuliaLang/julia/blob/02aeb44299d090d50d2c58e004f58a8b8d4f3da6/base/complex.jl

gemm! fails for some combinations of transpose characters

using OpenCL
import OpenCL.cl.CLArray
import CLBLAS

CLBLAS.setup()
device, ctx, queue = CLBLAS.get_next_compute_context()

hA = rand(5, 10) + im*rand(5, 10)
hB = rand(10, 5) + im*rand(10, 5)
hC = rand(5, 5) + im*rand(5, 5)
hC2 = rand(10, 10) + im*rand(10, 10)

A = CLArray(queue, hA)
B = CLArray(queue, hB)
C = CLArray(queue, hC)
C2 = CLArray(queue, hC2)

BLAS.gemm!('N', 'N', complex(1.0), hA, hB, complex(0.0), hC)
CLBLAS.gemm!('N', 'N', complex(1.0), A, B, complex(0.0), C)
hC ≈ cl.to_host(C) # true

BLAS.gemm!('T', 'T', complex(1.0), hA, hB, complex(0.0), hC2)
CLBLAS.gemm!('T', 'T', complex(1.0), A, B, complex(0.0), C2) # produces error CLError(code=-1016, CL_UNKNOWN_ERROR_CODE)

BLAS.gemm!('C', 'C', complex(1.0), hA, hB, complex(0.0), hC2)
CLBLAS.gemm!('C', 'C', complex(1.0), A, B, complex(0.0), C2)
hC2 ≈ cl.to_host(C2) # false

BLAS.gemm!('T', 'N', complex(1.0), hA, hA, complex(0.0), hC2)
CLBLAS.gemm!('T', 'N', complex(1.0), A, A, complex(0.0), C2) # produces error CLError(code=-1016, CL_UNKNOWN_ERROR_CODE)

Examples with real numbers also fail.

gbmv! prone to NaNs in y

This behaviour is inconsistent (and prevents use of similar):

alpha = T(2.0)
beta = T(0.0)
hA = rand(T, 4, 32)
hB = rand(T, 32)
m = 33
hC = rand(T, m)
A = CLArray(hA)
B = CLArray(hB)
C = CLArray(hC)
isnan(sum(BLAS.gbmv!('N', m, 1, 2, alpha, A, B, beta, C))) # false
C[1] = NaN
isnan(sum(BLAS.gbmv!('N', m, 1, 2, alpha, A, B, beta, C)) ) # true
hC[1] = NaN
isnan(sum(BLAS.gbmv!('N', m, 1, 2, alpha, hA, hB, beta, hC))) # false

High-level API for norms and inner products

It would be very nice to have high-level methods of norm and dot for JuliaGPU/GPUArrays.jl#66 and JuliaGPU/GPUArrays.jl#122.

It seems to be possible to get some working version of high-level functions by adding to highlevel.jl:

## NRM2
import Base.LinAlg.BLAS: nrm2

for (func, elty) in [(:clblasSnrm2, Float32), (:clblasDnrm2, Float64),
                    (:clblasCnrm2, CL_float2), (:clblasZnrm2, CL_double2)]

    @eval function nrm2(n::Integer, x::CLArray{$elty}, incx::Integer;
                        queue=cl.queue(x))
        # need temporary buffers
        ctx = cl.context(x)
        norm2_buff = cl.Buffer($elty, ctx, :w, 1)
        scratch_buff = cl.Buffer($elty, ctx, :rw, 2*length(x))

        $func(Csize_t(n), pointer(norm2_buff), Csize_t(0), pointer(x), Csize_t(0), Cint(incx),
              pointer(scratch_buff), [queue])

        # read return value
        result = Vector{$elty}(1)
        cl.enqueue_read_buffer(queue, norm2_buff, result, Csize_t(0), nothing, true)
        @inbounds norm2 = result[1]

        return norm2
    end

end

However, this seems to be far from optimal. The corresponding clBLAS functions use a temporary buffer scratch_buff that has to be allocated for each call. Here are some benchmarks using the implementation above (I did not make a PR since I think it is too bad):

julia> using CuArrays, CLArrays, GPUArrays, BenchmarkTools

julia> v = rand(Float32, 100^3); dvu = CuArray(v); dvl = CLArray(v);

julia> @benchmark norm($v)
BenchmarkTools.Trial: 
  memory estimate:  0 bytes
  allocs estimate:  0
  --------------
  minimum time:     225.994 μs (0.00% GC)
  median time:      226.209 μs (0.00% GC)
  mean time:        226.688 μs (0.00% GC)
  maximum time:     337.346 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1

julia> @benchmark norm($dvu)
BenchmarkTools.Trial: 
  memory estimate:  128 bytes
  allocs estimate:  2
  --------------
  minimum time:     55.020 μs (0.00% GC)
  median time:      64.425 μs (0.00% GC)
  mean time:        62.889 μs (0.00% GC)
  maximum time:     582.534 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1

julia> @benchmark sqrt(mapreduce(abs2, +, dvl))
BenchmarkTools.Trial: 
  memory estimate:  13.03 KiB
  allocs estimate:  298
  --------------
  minimum time:     226.478 μs (0.00% GC)
  median time:      251.947 μs (0.00% GC)
  mean time:        261.367 μs (1.16% GC)
  maximum time:     17.595 ms (29.41% GC)
  --------------
  samples:          10000
  evals/sample:     1

ulia> @time LinAlg.BLAS.nrm2(length(dvl), GPUArrays.blasbuffer(dvl), 1)
  0.001456 seconds (83 allocations: 2.438 KiB)
577.3568f0

julia> @time LinAlg.BLAS.nrm2(length(dvl), GPUArrays.blasbuffer(dvl), 1)
  0.000734 seconds (83 allocations: 2.438 KiB)
577.3568f0

julia> @time LinAlg.BLAS.nrm2(length(dvl), GPUArrays.blasbuffer(dvl), 1)
  0.001154 seconds (83 allocations: 2.438 KiB)
577.3568f0

julia> @time LinAlg.BLAS.nrm2(length(dvl), GPUArrays.blasbuffer(dvl), 1)
  0.001699 seconds (83 allocations: 2.438 KiB)
577.3568f0

julia> @time LinAlg.BLAS.nrm2(length(dvl), GPUArrays.blasbuffer(dvl), 1)
  0.000760 seconds (83 allocations: 2.438 KiB)
577.3568f0

I have used @time for the last tests, since I get the following error if I run @benchmark on LinAlg.BLAS.nrm2(length(dvl), GPUArrays.blasbuffer(dvl), 1):

julia> @benchmark LinAlg.BLAS.nrm2(length($dvl), GPUArrays.blasbuffer($dvl), 1)
ERROR: CLError(code=-4, CL_MEM_OBJECT_ALLOCATION_FAILURE)
Stacktrace:
 [1] #clblasSnrm2#119(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Ptr{Void}, ::UInt64, ::Ptr{Void}, ::UInt64, ::Int32, ::Ptr{Void}, ::Array{OpenCL.cl.CmdQueue,1}) at /home/.../.julia/v0.6/CLBLAS/src/macros.jl:132
 [2] #nrm2#451(::OpenCL.cl.CmdQueue, ::Function, ::Int64, ::OpenCL.cl.CLArray{Float32,1}, ::Int64) at /home/.../.julia/v0.6/CLBLAS/src/highlevel.jl:57
 [3] ##core#743(::CLArrays.CLArray{Float32,1}, ::CLArrays.CLArray{Float32,1}) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:316
 [4] ##sample#744(::BenchmarkTools.Parameters) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:324
 [5] #_lineartrial#23(::Int64, ::Array{Any,1}, ::Function, ::BenchmarkTools.Benchmark{Symbol("##benchmark#742")}, ::BenchmarkTools.Parameters) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:92
 [6] _lineartrial(::BenchmarkTools.Benchmark{Symbol("##benchmark#742")}, ::BenchmarkTools.Parameters) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:84
 [7] #lineartrial#20(::Array{Any,1}, ::Function, ::BenchmarkTools.Benchmark{Symbol("##benchmark#742")}, ::BenchmarkTools.Parameters) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:47
 [8] #tune!#26(::Bool, ::String, ::Array{Any,1}, ::Function, ::BenchmarkTools.Benchmark{Symbol("##benchmark#742")}, ::BenchmarkTools.Parameters) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:156
 [9] tune!(::BenchmarkTools.Benchmark{Symbol("##benchmark#742")}) at /home/.../.julia/v0.6/BenchmarkTools/src/execution.jl:155

Unable to run the example clblasSgemmRandomBufferFuture.jl

Whenever I try to run clblasSgemmRandomBufferFuture.jl I get this error:

ERROR: CLError(code=-11, CL_BUILD_PROGRAM_FAILURE)

I'm not certain yet- but I think the kernel in rand.cl is incorrect or somehow the kernel source is being corrupted.

At least I've narrowed it down to the offending method call in rand.jl :

p = cl.build!(p, options=string("-I", joinpath(dirname(Base.source_path()), "../", " -w")))

p = cl.build!(p, options=string("-I", joinpath(dirname(Base.source_path()), "../", " -w")))

Who is maintainer of this package?

I believe it's time to bring this package to the next level, providing high-level API, documentation and all other signs of maturity. I've already started some changes and plan to make much more, but I don't want to break old APIs and go against old ideas without agreement with maintainers / original authors of this package. So I wonder who should I address for decision regarding important changes?

cc: @ekobir @jakebolewski

If nobody is currently responsible for this package, I'd like to take over it (including bugs and improvements).

ERROR: error compiling setup: error compiling setup: error compiling clblasSetup: could not load module libclBLAS: The specified module could not be found.

After attempting to use CLBLAS having installed via a Pkg.clone( CLBLAS git url )

I see the following error:

ERROR: error compiling setup: error compiling setup: error compiling clblasSetup: could not load module libclBLAS: The specified module could not be found.

Which must be referring to this code since it's the only place where libclBLAS is specified

const libCLBLAS = "libclBLAS"

...
            function $(esc(func))($(args_in...))
                local err::cl.CL_int = ccall(($(string(func)), libCLBLAS),
                                                cl.CL_int,
                                                $arg_types,
                                                $(args_in...))
                 if err != cl.CL_SUCCESS
                    throw(cl.CLError(err))
                 end
                 return err
             end

I suppose that somehow I'm missing that libclBLAS on windows

Test failures

WARNING: deprecated syntax "typealias CL_float2 Complex64" at C:\Users\Mus\.julia\v0.6\CLBLAS\src\constants.jl:4.
Use "const CL_float2 = Complex64" instead.

WARNING: deprecated syntax "typealias CL_double2 Complex128" at C:\Users\Mus\.julia\v0.6\CLBLAS\src\constants.jl:5.
Use "const CL_double2 = Complex128" instead.
CLBLAS axpy: Error During Test
  Got an exception of type OpenCL.cl.CLError outside of a @test
  CLError(code=-33, CL_INVALID_DEVICE)
  Stacktrace:
   [1] #clblasDaxpy#56(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\macros.jl:132
   [2] #axpy!#444(::OpenCL.cl.CmdQueue, ::Function, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::OpenCL.cl.CLArray{Float64,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\highlevel.jl:23
   [3] (::Base.LinAlg.#kw##axpy!)(::Array{Any,1}, ::Base.LinAlg.#axpy!, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::OpenCL.cl.CLArray{Float64,1}) at .\<missing>:0
   [4] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:10 [inlined]
   [5] macro expansion at .\test.jl:853 [inlined]
   [6] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:0 [inlined]
   [7] macro expansion at .\test.jl:853 [inlined]
   [8] anonymous at .\<missing>:?
   [9] include_from_node1(::String) at .\loading.jl:539
   [10] include(::String) at .\sysimg.jl:14
   [11] include_from_node1(::String) at .\loading.jl:539
   [12] include(::String) at .\sysimg.jl:14
   [13] process_options(::Base.JLOptions) at .\client.jl:305
   [14] _start() at .\client.jl:371
CLBLAS scal: Error During Test
  Got an exception of type OpenCL.cl.CLError outside of a @testERROR (unhandled task failure): MethodError: no method matching unsafe_string(::Ptr{Void})
Closest candidates are:
  unsafe_string(::Cstring) at c.jl:79
  unsafe_string(::Union{Ptr{Int8}, Ptr{UInt8}}, ::Integer) at strings/string.jl:35
  unsafe_string(::Union{Ptr{Int8}, Ptr{UInt8}}) at strings/string.jl:39
Stacktrace:
 [1] macro expansion at C:\Users\Mus\.julia\v0.6\OpenCL\src\context.jl:95 [inlined]
 [2] (::OpenCL.cl.##43#44)() at .\task.jl:335

  CLError(code=-33, CL_INVALID_DEVICE)
  Stacktrace:
   [1] #clblasDscal#26(::Array{Ptr{Void},1}, ::Function, ::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\macros.jl:132
   [2] clblasDscal(::UInt64, ::Float64, ::Ptr{Void}, ::UInt64, ::Int32, ::Array{OpenCL.cl.CmdQueue,1}) at C:\Users\Mus\.julia\v0.6\CLBLAS\src\macros.jl:110
   [3] (::Base.LinAlg.BLAS.#kw##scal!)(::Array{Any,1}, ::Base.LinAlg.BLAS.#scal!, ::Int64, ::Float64, ::OpenCL.cl.CLArray{Float64,1}, ::Int64) at .\<missing>:0
   [4] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:29 [inlined]
   [5] macro expansion at .\test.jl:853 [inlined]
   [6] macro expansion at C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl:0 [inlined]
   [7] macro expansion at .\test.jl:853 [inlined]
   [8] anonymous at .\<missing>:?
   [9] include_from_node1(::String) at .\loading.jl:539
   [10] include(::String) at .\sysimg.jl:14
   [11] include_from_node1(::String) at .\loading.jl:539
   [12] include(::String) at .\sysimg.jl:14
   [13] process_options(::Base.JLOptions) at .\client.jl:305
   [14] _start() at .\client.jl:371
Test Summary: | Pass  Error  Total
CLBLAS.L1     |    2      2      4
  CLBLAS axpy |    1      1      2
  CLBLAS scal |    1      1      2
ERROR: LoadError: LoadError: Some tests did not pass: 2 passed, 0 failed, 2 errored, 0 broken.
while loading C:\Users\Mus\.julia\v0.6\CLBLAS\test\test_l1.jl, in expression starting on line 1
while loading C:\Users\Mus\.julia\v0.6\CLBLAS\test\runtests.jl, in expression starting on line 11
====================================================================================================================================[ ERROR: CLBLAS ]====================================================================================================================================
failed process: Process(`'C:\Julia\Julia-0.6-latest\bin\julia' -Cnative '-JC:\Julia\Julia-0.6-latest\lib\julia\sys.dll' --compile=yes --depwarn=yes --check-bounds=yes --code-coverage=none --color=yes --compilecache=yes 'C:\Users\Mus\.julia\v0.6\CLBLAS\test\runtests.jl'`, ProcessExited(1)) [1]

=========================================================================================================================================================================================================================================================================================
INFO: No packages to install, update or remove
ERROR: CLBLAS had test errors

Transfer Ownership

@ekobir could you transfer ownership of this repo to JuliaGPU? You should be a collaborator so nothing really changes. One other change would be to update METADATA to point to the new "official" repo location.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.