Giter Club home page Giter Club logo

calx's People

Contributors

ztellman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

calx's Issues

Not clear how to do 2 or 3D problems.

Hello.
Your example in the readme states:
(enqueue-kernel :square 3 a b)
where the 3 refers to the global size of the problem, as in the gid in:
int gid = get_global_id(0)

I would like to write a kernel with 2 (or 3) dimensions, say with
int col = get_global_id(0);
int row = get_global_id(1);

Problem is, I do not see how to state the sizes of each of these(col, row), as you did for gid.
I guess the function enqueue-kernel would need to extend or have a Ndimentional version of it?
Also, the function enqueue-kernel does not seem to be in the doc file you point to in the read me.

How would you approach a 2 problem with calx?
I'm thinking of a 1D data buffer, which, via it's layout, encodes a 2D data, then I'd apply mod(gid,rowWidth) for work on rows and floor(gid/colHight) for columns?

Many thanks!

Ludo

How to use local function /set local_size.

Hello.

I note that the file calx/src/calx/core.clj contains the 'local' function defined as:

(defn local [size]
  (CLKernel$LocalSize. size))

I'm designing a kernel for which I will want to set the local work size myself, however, I do not see how I can set this veritable. I attempted to set this within the 'let' as per the example below, however this has no effect. Placing the 'local' function call anywhere else fails with 'Unable to resolve symbol: sourceOpenCL2'.
How could I put this option into effect? A side question, is there a public repo that uses calx that I could use a learning material?

I know the local size is not changing (stays as 256) because of a kernel with something like this:
int lid = get_local_id(0); ....
outvector[gid] = lid ; //The output values loop round 255

Kind regards.

Ludo

(use 'calx)

(def source
  "__kernel void square (
       __global const float *a,
       __global float *b) {
    int gid = get_global_id(0);
    b[gid] = a[gid] * a[gid];
  }")

(with-cl
  (with-program (compile-program source)
    (let [a (wrap [1 2 3] :float32)
          b (mimic a)]
      (local 64)         ;;This seem to have no effect
      (enqueue-kernel :square 3 a b)
      (enqueue-read b))))

Potemkin import-fn issues

Hey Zach,

I'm trying to update your calx code to work with 1.3. The binding vars stuff is pretty easy to fix but the import-fn stuff is giving me problems.

Its giving me:
;user=> (clojure.repl/pst)
NullPointerException
java.util.concurrent.ConcurrentHashMap.get (ConcurrentHashMap.java:768)
clojure.lang.Namespace.find (Namespace.java:188)
clojure.core/find-ns (core.clj:3657)
clojure.core/the-ns (core.clj:3689)
clojure.core/intern (core.clj:5561)
potemkin.namespace/import-fn (namespace.clj:16)
clojure.lang.Var.invoke (Var.java:409)
clojure.lang.Var.applyTo (Var.java:518)
clojure.lang.Compiler.macroexpand1 (Compiler.java:6320)
clojure.lang.Compiler.macroexpand (Compiler.java:6381)
clojure.lang.Compiler.macroexpand (Compiler.java:6383)
clojure.lang.Compiler.eval (Compiler.java:6449)

I tried using the most recent version of potemkin but I'm still getting the same error. You know what's going on here?

Best,
Brent

keywords aren't glossy

java.lang.IllegalArgumentException: No implementation of method: :sizeof of protocol: #'gloss.core.protocols/Writer found for class: clojure.lang.Keyword (cl.clj:0)

when running the example from README.

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.