GithubHelp home page GithubHelp logo

ahayashi / chapel-gpu Goto Github PK

View Code? Open in Web Editor NEW
19.0 3.0 6.0 6.21 MB

GPUIterator for the Chapel language

License: Other

Chapel 51.88% Cuda 14.22% Makefile 3.05% Shell 2.56% C 24.19% CMake 3.93% C++ 0.18%
chapel-language gpu-computing cuda

chapel-gpu's Introduction

Chapel-GPU: GPUIterator and GPUAPI module for Chapel

Documents

building docs

Detailed description of the modules can be found here.

License

The GPUIterator and GPUAPI modules are developed and released under the terms of the Apache 2.0 license. See the LICENSE file in this directory for details.

Further Readings

chapel-gpu's People

Contributors

ahayashi avatar milthorpe avatar psath avatar srirajpaul avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

chapel-gpu's Issues

GPUIterator and GPU Kernel Generation in Chapel via symbolic variables [Idea; Collaboration?]

Hello, developers of the GPUIterator!

I was thinking that perhaps this is a way to either provide as an idea or a potential point of collaboration for improving GPU support in Chapel. A while ago, I was working on a side-project that utilized symbolic variables to generate GPU kernels in Chapel, allowing users to write Chapel-idiomatic code that will run on the GPU: https://github.com/LouisJenkinsCS/ChapelCL

For example, I had envisioned that something like this...

var D = {1..N} dmapped Symbolic();
var dA : [D] real(32);
var dB : [D] real(32);
forall (a, b) in zip(dA, dB) {
   a = b;
}

Or even better

var D = {1..N} dmapped Symbolic();
var dA : [D] real(32);
var dB : [D] real(32);
dA = dB;

Which would generate the following...

// CUDA kernel for Vector Copy
__global__ void vc(float *dA, float *dB, int N) {
    int id = blockIdx.x * blockDim.x + threadIdx.x;
    if (id < N) {
	  dA[id] = dB[id];
    }
}

The Symbolic would correspond to the SymbolicDist, which would essentially create a distribution for an array that internally tracked the size of the array and returned a reference to a symbolic variable when iterated over or when indexed into that recorded certain actions, such as the operations +, -, *, /, etc.

My hope was that you could write something like the above to create a GPU kernel, but with your own GPUIterator, I'm thinking that this generated GPU kernel could be fed directly to your GPUIterator.

Unfortunately things like handling device-to-host and host-to-device transfers have not been implemented yet, but they were planned. Unfortunately I do not have the time to devote to do a solo project of this magnitude, despite how cool it sounds to me. Hopefully your research group will be interested in continuing the work or in collaboration?

Edit:

I should mention that the side-project is also mostly unfinished and only a basic proof-of-concept is working; I believe the last thing I did was create the AST (which gets generated based on operators applied to symbolic varialbes) and the SymbolicDist (symbolic array), but it showed that something like this can work in Chapel.

Compiler error

Hi,
Congratulations on the amazing work.
I am suffering some issues to compile an example:

CHPL_LOCALE_MODEL=gpu chpl --fast -M $CHPL_GPU_HOME/chapel-gpu/src vc.hybrid.chpl vc.gpu.o -lcudart -lcuda
error: Type 'chpl_localeID_t' must be defined in the Chapel internal modules.
error: Type 'chpl_comm_on_bundle_t' must be defined in the Chapel internal modules.
error: Type 'chpl_task_bundle_t' must be defined in the Chapel internal modules.

My chapel is:

chpl version 1.20.0
Copyright (c) 2004-2019, Cray Inc.  (See LICENSE file for more details)

nvcc is:

nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2017 NVIDIA Corporation
Built on Fri_Sep__1_21:08:03_CDT_2017
Cuda compilation tools, release 9.0, V9.0.176

I am using clang-3.9. I can compile Cuda 9 programs and works pretty well;

I am using ubuntu 18.04 LTS.
Can you give me some tips to solve such an issue?
Thanks.

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.