Coder Social home page Coder Social logo

opencl-kernels's People

Contributors

colinschmidt avatar sagark avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

opencl-kernels's Issues

Several kernels perform excessive clEnqueueWriteBuffer()

Take the following example:

for (int i=0; i<NUM_DATA; i++) {
    float in = ((float)rand()/(float)(RAND_MAX)) * 100.0;
        CL_CHECK(clEnqueueWriteBuffer(queue, input_buffer, CL_TRUE, i*sizeof(float), 4, &in, 0, NULL, NULL));
}

Instead of preparing a single random buffer and enqueueing this for upload, this code enqueues 65536
synchronous small upload commands. This does not appear to affect measured execution times, but has a few drawbacks. Firstly this is trivially inefficient in terms of CPU cycles and (PCIe/...) bus usage. Secondly it causes valgrind-mmt to output excessively large log files (167MiB, expected <8MB), adding significant overhead on subsequent processing when trying to inspect the generated assembly for saxpy on NVIDIA GPUs.

Before I naively propose a patch to try and make data upload and download more efficient, I'd like to ask for the rationale behind it. Presumably the hwacha simulation methods forbid the use of malloc(). Is there a reason not to use a static buffer of either size NUM_DATA or a smaller fixed size that we can use to aggregate uploads?
Thanks,

Roy

Missing encoding.h

When attempting a "make bare" compile of these OpenCL kernels (using the v4 branch of pocl), gcc bails with the following error message:
../common/crt.S:3:22: fatal error: encoding.h: No such file or directory

Unfortunately, I don't know what the source of this header file should be. An attempt at fetching it from riscv-tools/riscv-isa-sim/riscv/encoding.h results in a long list of error messages during compilation:

../common/crt.S: Assembler messages:
../common/crt.S:67: Error: illegal operands `li t0,MSTATUS_PRV1'
../common/crt.S:68: Error: illegal operands `li t0,MSTATUS_IE1'
../common/crt.S:73: Error: Instruction csrr requires absolute expression
../common/crt.S:151: Error: unrecognized opcode `eret'
../common/crt.S:227: Error: unrecognized opcode `eret'
Makefile:17: recipe for target 'crt.o' failed
make: *** [crt.o] Error 1
make: *** Waiting for unfinished jobs....
Makefile:24: recipe for target 'kernel.rv.S' failed
make: *** [kernel.rv.S] Aborted (core dumped)
../common/syscalls.c: Assembler messages:
../common/syscalls.c:65: Error: Instruction csrw requires absolute expression
../common/syscalls.c:72: Error: Instruction csrr requires absolute expression
../common/syscalls.c:65: Error: Instruction csrw requires absolute expression
../common/syscalls.c:25: Error: Instruction csrw requires absolute expression
../common/syscalls.c:26: Error: Instruction csrrw requires absolute expression
../common/syscalls.c:26: Error: Instruction csrrw requires absolute expression
../common/syscalls.c:44: Error: Instruction csrrs requires absolute expression
../common/syscalls.c:44: Error: Instruction csrrs requires absolute expression
../common/syscalls.c:53: Error: Instruction csrr requires absolute expression
../common/syscalls.c:53: Error: Instruction csrr requires absolute expression
../common/syscalls.c:53: Error: Instruction csrr requires absolute expression
../common/syscalls.c:53: Error: Instruction csrr requires absolute expression
../common/syscalls.c:54: Error: Instruction csrr requires absolute expression
../common/syscalls.c:54: Error: Instruction csrr requires absolute expression
../common/syscalls.c:54: Error: Instruction csrr requires absolute expression
../common/syscalls.c:54: Error: Instruction csrr requires absolute expression
../common/syscalls.c:55: Error: Instruction csrr requires absolute expression
../common/syscalls.c:55: Error: Instruction csrr requires absolute expression
../common/syscalls.c:55: Error: Instruction csrr requires absolute expression
../common/syscalls.c:55: Error: Instruction csrr requires absolute expression
../common/syscalls.c:56: Error: Instruction csrr requires absolute expression
../common/syscalls.c:56: Error: Instruction csrr requires absolute expression
../common/syscalls.c:56: Error: Instruction csrr requires absolute expression
../common/syscalls.c:56: Error: Instruction csrr requires absolute expression
../common/syscalls.c:59: Error: Instruction csrrc requires absolute expression
../common/syscalls.c:59: Error: Instruction csrrc requires absolute expression
Makefile:20: recipe for target 'syscalls.o' failed
make: *** [syscalls.o] Error 1

Where should this include file come from? And if it was supposed to be installed by the riscv64 cross compiler suite, shouldn't it be included using #include <encoding.h> rather than #include "encoding.h"?

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.