# GPU

**URL:** https://discourse.julialang.org/c/domain/gpu/11.md?page=32

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 33

---

## [Performance of view with cuArrays](https://discourse.julialang.org/t/performance-of-view-with-cuarrays/17387)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 11\
**Last updated:** [November 11, 2018, 9:09pm UTC](https://discourse.julialang.org/t/performance-of-view-with-cuarrays/17387 "2018-11-11T21:09:42Z")

</div>

Hi, Let x and y be 2 3D arrays of Float32 with size (200,200,200) I would like to perform the following operation y\[i,:,:\]=x\[i+1,:,:\]-x\[i,:,:\] for i in \[1:199\] I have implement this in a function that can be called b…

---

## [Is is possible to merge multiple kernels in CUDAnative to minimize launch overhead and execution overhead?](https://discourse.julialang.org/t/is-is-possible-to-merge-multiple-kernels-in-cudanative-to-minimize-launch-overhead-and-execution-overhead/17139)

<div class="topic-metadata">

**Author:** [@1115](https://discourse.julialang.org/u/1115)\
**Replies:** 12\
**Last updated:** [November 11, 2018, 3:19pm UTC](https://discourse.julialang.org/t/is-is-possible-to-merge-multiple-kernels-in-cudanative-to-minimize-launch-overhead-and-execution-overhead/17139 "2018-11-11T15:19:24Z")

</div>

I defined several inplace operations on a vector, but the overhead is significant. julia\> using CuArrays, CUDAnative, LinearAlgebra, BenchmarkTools julia\> function ms1!(X::CuArray, a, b, c) function kernel(X…

---

## [Is there any plan for GPU linear algebra?](https://discourse.julialang.org/t/is-there-any-plan-for-gpu-linear-algebra/16766)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 3\
**Last updated:** [October 25, 2018, 9:11am UTC](https://discourse.julialang.org/t/is-there-any-plan-for-gpu-linear-algebra/16766 "2018-10-25T09:11:02Z")

</div>

I was trying to transfer from PyTorch, however, we don’t have a magma wrapper at the moment, do we? So is there anything includes things like SVD on GPU? And is there any plan (or anyone interested in this) to make a wr…

---

## [Support for Complex-valued CuArray](https://discourse.julialang.org/t/support-for-complex-valued-cuarray/16177)

<div class="topic-metadata">

**Author:** [@fucai](https://discourse.julialang.org/u/fucai)\
**Replies:** 2\
**Last updated:** [October 12, 2018, 1:34am UTC](https://discourse.julialang.org/t/support-for-complex-valued-cuarray/16177 "2018-10-12T01:34:33Z")

</div>

It seems the support for complex -valued CuArray is not yet in place. Or, I may miss something here. Thanks. ‘’’ using GPUArrays, CuArrays x = randn(Float32, 3,3); x = complex(x); cx = cu(x); y = map(sin, cx) ‘’’ …

---

## [Can not use CuArray on Julia 0.7](https://discourse.julialang.org/t/can-not-use-cuarray-on-julia-0-7/16089)

<div class="topic-metadata">

**Author:** [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Replies:** 3\
**Last updated:** [October 10, 2018, 4:19pm UTC](https://discourse.julialang.org/t/can-not-use-cuarray-on-julia-0-7/16089 "2018-10-10T16:19:14Z")

</div>

When I use 0.7 and try to use CuArray, the following error happens: julia\> using CuArrays ┌ Warning: \`using A: B\` will only be allowed for single bindings, not modules. Use \`using A.B\` instead │ caller = ip:0x0 └ @ Co…

---

## [Support for Sparse Matrices on GPU (CUSPARSE)](https://discourse.julialang.org/t/support-for-sparse-matrices-on-gpu-cusparse/15294)

<div class="topic-metadata">

**Author:** [@mboratko](https://discourse.julialang.org/u/mboratko)\
**Replies:** 1\
**Last updated:** [September 22, 2018, 4:34pm UTC](https://discourse.julialang.org/t/support-for-sparse-matrices-on-gpu-cusparse/15294 "2018-09-22T16:34:17Z")

</div>

Do any of the ML libraries (Flux, KNet) support sparse matrices on the GPU?

---

## [Optimizing the use of Blocks, Threads vs. Array Indexing](https://discourse.julialang.org/t/optimizing-the-use-of-blocks-threads-vs-array-indexing/7537)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 15\
**Last updated:** [September 21, 2018, 3:09pm UTC](https://discourse.julialang.org/t/optimizing-the-use-of-blocks-threads-vs-array-indexing/7537 "2018-09-21T15:09:21Z")

</div>

Assume that in Julia I have the following, which I assume should be OK because arrays in Julia are column major. x = Array{Float32, 3}(500, 20, 200) # Initialize x for c = 1:200 for b = 1:20 for a = 1:500 …

---

## [Package use, CUDA stream support, etc](https://discourse.julialang.org/t/package-use-cuda-stream-support-etc/14868)

<div class="topic-metadata">

**Author:** [@drinkwell](https://discourse.julialang.org/u/drinkwell)\
**Replies:** 5\
**Last updated:** [September 13, 2018, 2:59pm UTC](https://discourse.julialang.org/t/package-use-cuda-stream-support-etc/14868 "2018-09-13T14:59:02Z")

</div>

Hi, I’m just starting to think about writing some Julia GPU code and am trying to bottom out a few things so would appreciate some pointers. First off, what are the currently preferred packages to use? I’ve Nvidia hard…

---

## [Flux four errors in Julia v0.7 none in v0.6.4](https://discourse.julialang.org/t/flux-four-errors-in-julia-v0-7-none-in-v0-6-4/14793)

<div class="topic-metadata">

**Author:** [@hskramer](https://discourse.julialang.org/u/hskramer)\
**Replies:** 1\
**Last updated:** [September 13, 2018, 5:48am UTC](https://discourse.julialang.org/t/flux-four-errors-in-julia-v0-7-none-in-v0-6-4/14793 "2018-09-13T05:48:01Z")

</div>

I’m starting my migration from v0.6.4 and when testing Flux it had four errors all related to to cudnn.jl with same message “Got exception ErrorException(“scalar getindex is disabled”) outside of a @test” . I tested all…

---

## [Computing eigenvalues/eigenvectors using GPU?](https://discourse.julialang.org/t/computing-eigenvalues-eigenvectors-using-gpu/12396)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 9\
**Last updated:** [September 11, 2018, 6:14pm UTC](https://discourse.julialang.org/t/computing-eigenvalues-eigenvectors-using-gpu/12396 "2018-09-11T18:14:29Z")

</div>

Hi everyone I have a Vega RX 64 and I would like to speed up eigenvalues decomposition on it. Does anybody know a (simple) solution with Julia ?

---

## [CUDAnative question: "recursion not currently supported error" when running reduce.jl example](https://discourse.julialang.org/t/cudanative-question-recursion-not-currently-supported-error-when-running-reduce-jl-example/14776)

<div class="topic-metadata">

**Author:** [@MeBlueDolphin](https://discourse.julialang.org/u/MeBlueDolphin)\
**Replies:** 1\
**Last updated:** [September 11, 2018, 7:57am UTC](https://discourse.julialang.org/t/cudanative-question-recursion-not-currently-supported-error-when-running-reduce-jl-example/14776 "2018-09-11T07:57:05Z")

</div>

I am trying to run your “reduce.jl” example with julia 0.7.0 on my PC laptop which has the 940MX card. I am getting the following “recursion not supported error:” julia\> include(“verify\_reduce.jl”) ERROR: LoadError: GP…

---

## [CuArray and Optim](https://discourse.julialang.org/t/cuarray-and-optim/14053)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 9\
**Last updated:** [September 4, 2018, 6:38am UTC](https://discourse.julialang.org/t/cuarray-and-optim/14053 "2018-09-04T06:38:41Z")

</div>

I am trying to write some deconvolution code in Julia via combining LBFGS Optimization (Optim.jl), automatic differentiation (AutoGrad.jl) and Cuda support (CuArray). Julia 1.0 on Windows 10. I finally have some runnab…

---

## [GPUArrays, 64-32bit conversions, and Cassete.jl](https://discourse.julialang.org/t/gpuarrays-64-32bit-conversions-and-cassete-jl/14294)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 8\
**Last updated:** [August 30, 2018, 3:06pm UTC](https://discourse.julialang.org/t/gpuarrays-64-32bit-conversions-and-cassete-jl/14294 "2018-08-30T15:06:30Z")

</div>

I’m writing some frameworks that run arbitrary user code on the GPU, but I’m missing the performance gains of using only 32bit numbers. Is anyone else thinking about automatic 32/64 bit code transformations using Casset…

---

## [LLVM crash when running Flux and CuArray examples in julia 0.7](https://discourse.julialang.org/t/llvm-crash-when-running-flux-and-cuarray-examples-in-julia-0-7/12967)

<div class="topic-metadata">

**Author:** [@rkat](https://discourse.julialang.org/u/rkat)\
**Replies:** 13\
**Last updated:** [August 21, 2018, 7:07am UTC](https://discourse.julialang.org/t/llvm-crash-when-running-flux-and-cuarray-examples-in-julia-0-7/12967 "2018-08-21T07:07:12Z")

</div>

I’m running on Ubuntu 16.04 with a Quadro K1200. I’m able to build and run all of the NVIDIA CUDA examples, but I can’t seem to get Flux/CuArrays working. I’m using julia 0.7 which is not well supported by Flux and CuArr…

---

## [Flux: GPU slower than CPU?](https://discourse.julialang.org/t/flux-gpu-slower-than-cpu/13072)

<div class="topic-metadata">

**Author:** [@rkat](https://discourse.julialang.org/u/rkat)\
**Replies:** 7\
**Last updated:** [August 10, 2018, 5:55am UTC](https://discourse.julialang.org/t/flux-gpu-slower-than-cpu/13072 "2018-08-10T05:55:08Z")

</div>

I have a loss function which I’ve defined using Flux. On my boring old CPU on one batch, it performs like this: julia\> @time loss(x, y) 0.071089 seconds (402 allocations: 20.235 MiB, 4.37% gc time) 1.3092503770133925 …

---

## [CLBlast, a tuned OpenCL BLAS library](https://discourse.julialang.org/t/clblast-a-tuned-opencl-blas-library/13082)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 6\
**Last updated:** [August 9, 2018, 2:54pm UTC](https://discourse.julialang.org/t/clblast-a-tuned-opencl-blas-library/13082 "2018-08-09T14:54:22Z")

</div>

I’ve written a wrapper for CLBlast, a " tuned OpenCL BLAS library", which can be found at GitHub - ranocha/CLBlast.jl: Julia wrapper of CLBlast, a "tuned OpenCL BLAS library".. Most parts seem to work and there is a perf…

---

## [CUDAdrv cannot find \_\_host\_\_ \_\_device\_\_ functions](https://discourse.julialang.org/t/cudadrv-cannot-find-host-device-functions/12682)

<div class="topic-metadata">

**Author:** [@cnliao](https://discourse.julialang.org/u/cnliao)\
**Replies:** 5\
**Last updated:** [July 29, 2018, 1:55pm UTC](https://discourse.julialang.org/t/cudadrv-cannot-find-host-device-functions/12682 "2018-07-29T13:55:41Z")

</div>

The example vadd.jl in CUDAdrv/examples will fail if one change the memory qualifier from \_\_global\_\_ to \_\_host\_\_ \_\_device\_\_ in the function signature. // vadd.cu extern "C" { \_\_host\_\_ \_\_device\_\_ void kernel\_vadd(const f…

---

## [What is the recommended type \<: Integer to use when doing index arithmetics?](https://discourse.julialang.org/t/what-is-the-recommended-type-integer-to-use-when-doing-index-arithmetics/12560)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 3\
**Last updated:** [July 24, 2018, 6:31am UTC](https://discourse.julialang.org/t/what-is-the-recommended-type-integer-to-use-when-doing-index-arithmetics/12560 "2018-07-24T06:31:10Z")

</div>

Hi, I have to compute the linear index in a CUDAnative kernel. I went to the source code pointer.jl in CUDAnative.jl but wasn’t able to get a clue. It seems to me that unsafe\_cached\_load deals with integers carefully, b…

---

## [Packing structs for OpenCL](https://discourse.julialang.org/t/packing-structs-for-opencl/12574)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 1\
**Last updated:** [July 23, 2018, 3:07pm UTC](https://discourse.julialang.org/t/packing-structs-for-opencl/12574 "2018-07-23T15:07:19Z")

</div>

I’m trying to use GPUArrays to broadcast on types that pack differently in Jullia and OpenCL, such as arrays of structs/tuples or structs containing tuples. Is this a bug in CLArrays that it doesn’t ‘just work’, or inte…

---

## [Sequence of warp and how to avoid divergence when folding shared memory in a reduction kernel](https://discourse.julialang.org/t/sequence-of-warp-and-how-to-avoid-divergence-when-folding-shared-memory-in-a-reduction-kernel/12468)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 3\
**Last updated:** [July 19, 2018, 5:34am UTC](https://discourse.julialang.org/t/sequence-of-warp-and-how-to-avoid-divergence-when-folding-shared-memory-in-a-reduction-kernel/12468 "2018-07-19T05:34:48Z")

</div>

Hi everyone, I jumped into CUDA programming mid-way without good background knowledge. It is just because CUDAnative.jl is so easy to program with. Now I have a problem related to CUDA, not not the package CUDAnative.jl.…

---

## [Constant Memory?](https://discourse.julialang.org/t/constant-memory/7606)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 11\
**Last updated:** [July 18, 2018, 12:38am UTC](https://discourse.julialang.org/t/constant-memory/7606 "2018-07-18T00:38:37Z")

</div>

I believe there is support for Shared Memory. However, I cannot find any references to Constant Memory being supported by CUDAnative. As I read through books on CUDA programming, it seems like a useful thing that will h…

---

## [Generic Kernels for CLArrays](https://discourse.julialang.org/t/generic-kernels-for-clarrays/12361)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 1\
**Last updated:** [July 16, 2018, 8:38am UTC](https://discourse.julialang.org/t/generic-kernels-for-clarrays/12361 "2018-07-16T08:38:38Z")

</div>

I’d like to take the minimum of a scalar field z subject to some mask d. To illustrate, z is a checkerboard pattern and d is a circle centered at c\_xy. N = 10 xy = \[(i, j) for i=1:N, j=1:N\] # coordinates z = \[(i+j)%2 +…

---

## [Load JULIA via "julia -p 8" and failed to load CUDAnative library](https://discourse.julialang.org/t/load-julia-via-julia-p-8-and-failed-to-load-cudanative-library/12220)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 3\
**Last updated:** [July 13, 2018, 3:19pm UTC](https://discourse.julialang.org/t/load-julia-via-julia-p-8-and-failed-to-load-cudanative-library/12220 "2018-07-13T15:19:09Z")

</div>

Hi Tim @maleadt I load julia via the following command xxx@XXX:~$ julia7 -p 6 \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://docs.jul…

---

## [Calling CUBLAS GEMM in Julia 0.6](https://discourse.julialang.org/t/calling-cublas-gemm-in-julia-0-6/10106)

<div class="topic-metadata">

**Author:** [@una-dinosauria](https://discourse.julialang.org/u/una-dinosauria)\
**Replies:** 4\
**Last updated:** [July 6, 2018, 7:16pm UTC](https://discourse.julialang.org/t/calling-cublas-gemm-in-julia-0-6/10106 "2018-07-06T19:16:52Z")

</div>

I had some code using CUBLAS.jl for matrix multiplication in the GPU. I updated some packages, and now my code is breaking apparently because CUDAdrv.jl does not support OwnedPtr anymore, and CUBLAS.jl relies heavily on…

---

## [Optimizing column reduce with CUDAnative](https://discourse.julialang.org/t/optimizing-column-reduce-with-cudanative/10909)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 5\
**Last updated:** [July 6, 2018, 6:22pm UTC](https://discourse.julialang.org/t/optimizing-column-reduce-with-cudanative/10909 "2018-07-06T18:22:25Z")

</div>

Hi everyone, I got a piece of code to optimize. It is the column reduce algorithm, which takes a 2d array and sums the first axis, then write to the 1d array as output. I have my code but it is sloww. Does anyone have g…

---

## [What is the optimal way of updating CuArray?](https://discourse.julialang.org/t/what-is-the-optimal-way-of-updating-cuarray/12182)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 7\
**Last updated:** [July 5, 2018, 6:17pm UTC](https://discourse.julialang.org/t/what-is-the-optimal-way-of-updating-cuarray/12182 "2018-07-05T18:17:42Z")

</div>

Hi, I observed an interesting behavior during the optimisation of my code with CUDAnative.jl I have the following code using CUDAnative using CUDAdrv for a=1:100 for b=1:100 X = ... # rather complicated …

---

## [What is the maximal number of arguments a CUDAnative kernel can take? argc = 16 yields "Error: invalid kernel call; too many arguments"](https://discourse.julialang.org/t/what-is-the-maximal-number-of-arguments-a-cudanative-kernel-can-take-argc-16-yields-error-invalid-kernel-call-too-many-arguments/12143)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 6\
**Last updated:** [July 4, 2018, 8:46am UTC](https://discourse.julialang.org/t/what-is-the-maximal-number-of-arguments-a-cudanative-kernel-can-take-argc-16-yields-error-invalid-kernel-call-too-many-arguments/12143 "2018-07-04T08:46:51Z")

</div>

I have a kernel to pass to @cuda in CUDAnative.jl. It is a kernel function which takes 16 arguments: function TrAXBY\_CUDA!(cuTMP,G1,G2,Ind2,IX,JX,VX,IY,JY,VY,nΩ,nK,nnzX,nnzY,dimX,dimY) ... ... return n…

---

## [Store CuArrays on a mutable struct?](https://discourse.julialang.org/t/store-cuarrays-on-a-mutable-struct/11605)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 5\
**Last updated:** [July 2, 2018, 8:17pm UTC](https://discourse.julialang.org/t/store-cuarrays-on-a-mutable-struct/11605 "2018-07-02T20:17:34Z")

</div>

hi, I seem to understand that I cannot store a (reference to?) a CuArray on a struct: mutable struct Param eta :: Float64 beta :: Float64 alpha :: Float64 delta :: Float64 mu :: Float64 rho :: Float64 sigm…

---

## [Can I change the nvcc location in CUDAnative?](https://discourse.julialang.org/t/can-i-change-the-nvcc-location-in-cudanative/12000)

<div class="topic-metadata">

**Author:** [@cuchxq](https://discourse.julialang.org/u/cuchxq)\
**Replies:** 5\
**Last updated:** [June 29, 2018, 3:05pm UTC](https://discourse.julialang.org/t/can-i-change-the-nvcc-location-in-cudanative/12000 "2018-06-29T15:05:18Z")

</div>

Hi, when I am building “CUDAnative” package on a server, I get the following error: \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://doc…

---

## [Mapping ThreadIdx().x to a 5D array?](https://discourse.julialang.org/t/mapping-threadidx-x-to-a-5d-array/11693)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 8\
**Last updated:** [June 15, 2018, 5:59pm UTC](https://discourse.julialang.org/t/mapping-threadidx-x-to-a-5d-array/11693 "2018-06-15T17:59:10Z")

</div>

I have the following big picture aim. Suppose I have a high dimensional array, e.g. 5D or 6D. On each index of those arrays, an independent computation delivers a different value that needs to be stored at this index. Fo…

[Previous page](https://discourse.julialang.org/c/domain/gpu/11.md?page=31)

[Next page](https://discourse.julialang.org/c/domain/gpu/11.md?page=33)
