ucb-bar / opencl-kernels Goto Github PK
View Code? Open in Web Editor NEWOpenCL kernels for ucb-bar hardware
OpenCL kernels for ucb-bar hardware
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
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"
?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.