www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Cuda for C++

reply bearophile <bearophileHUGS lycos.com> writes:
"Thrust is a CUDA library of parallel algorithms with an interface resembling
the C++ Standard Template Library (STL). Thrust provides a flexible high-level
interface for GPU programming":
http://code.google.com/p/thrust/

Something like this (but OpenCL) for D sounds quite interesting.

Bye,
bearophile
May 29 2009
parent reply Trass3r <mrmocool gmx.de> writes:
bearophile schrieb:
 "Thrust is a CUDA library of parallel algorithms with an interface resembling
the C++ Standard Template Library (STL). Thrust provides a flexible high-level
interface for GPU programming":
 http://code.google.com/p/thrust/
 
 Something like this (but OpenCL) for D sounds quite interesting.
 

Hopefully OpenCL's runtime will be compatible to D's: Chris R Miller wrote (in Feb):
 I looked into writing CUDA with D a while back.  The problem is that the
 CUDA C runtime and the D runtime are 100% incompatible.

I don't have any new information about the topic though. Maybe it works with druntime.
May 29 2009
next sibling parent "Denis Koroskin" <2korden gmail.com> writes:
On Fri, 29 May 2009 15:28:00 +0400, Trass3r <mrmocool gmx.de> wrote:

 bearophile schrieb:
 "Thrust is a CUDA library of parallel algorithms with an interface  
 resembling the C++ Standard Template Library (STL). Thrust provides a  
 flexible high-level interface for GPU programming":
 http://code.google.com/p/thrust/
  Something like this (but OpenCL) for D sounds quite interesting.

Hopefully OpenCL's runtime will be compatible to D's: Chris R Miller wrote (in Feb): > I looked into writing CUDA with D a while back. The problem is that the > CUDA C runtime and the D runtime are 100% incompatible. I don't have any new information about the topic though. Maybe it works with druntime.

Yeah, OpenCL looks interesting. For example, they annotate variables with either __global, __local or __private attributes, that are very close to D2 shared/TLS/unique.
May 29 2009
prev sibling next sibling parent "Robert Jacques" <sandford jhu.edu> writes:
On Fri, 29 May 2009 07:28:00 -0400, Trass3r <mrmocool gmx.de> wrote:

 bearophile schrieb:
 "Thrust is a CUDA library of parallel algorithms with an interface  
 resembling the C++ Standard Template Library (STL). Thrust provides a  
 flexible high-level interface for GPU programming":
 http://code.google.com/p/thrust/
  Something like this (but OpenCL) for D sounds quite interesting.

Hopefully OpenCL's runtime will be compatible to D's: Chris R Miller wrote (in Feb): > I looked into writing CUDA with D a while back. The problem is that the > CUDA C runtime and the D runtime are 100% incompatible. I don't have any new information about the topic though. Maybe it works with druntime.

Umm... I've gotten D's and CUDA's runtime to play nice together.
May 29 2009
prev sibling next sibling parent Robert Fraser <fraserofthenight gmail.com> writes:
Trass3r wrote:
 bearophile schrieb:
 "Thrust is a CUDA library of parallel algorithms with an interface 
 resembling the C++ Standard Template Library (STL). Thrust provides a 
 flexible high-level interface for GPU programming":
 http://code.google.com/p/thrust/

 Something like this (but OpenCL) for D sounds quite interesting.

Hopefully OpenCL's runtime will be compatible to D's: Chris R Miller wrote (in Feb): > I looked into writing CUDA with D a while back. The problem is that the > CUDA C runtime and the D runtime are 100% incompatible. I don't have any new information about the topic though. Maybe it works with druntime.

Isn't there a dcuda project at team0xf? Not sure what state it's in, though. I'd say OpenCL/DirectX Compute Shaders are the future... CUDA is only supported on NVIDIA, and as a proud ATI user, I must take exception.
May 29 2009
prev sibling next sibling parent Walter Bright <newshound1 digitalmars.com> writes:
Trass3r wrote:
 I don't have any new information about the topic though.

No problem: http://www.seriouswheels.com/1970-1979/1970-Plymouth-Hemi-Cuda-Orange-FA.htm
May 29 2009
prev sibling parent "Robert Jacques" <sandford jhu.edu> writes:
On Fri, 29 May 2009 07:33:55 -0400, Denis Koroskin <2korden gmail.com>  
wrote:

 On Fri, 29 May 2009 15:28:00 +0400, Trass3r <mrmocool gmx.de> wrote:

 bearophile schrieb:
 "Thrust is a CUDA library of parallel algorithms with an interface
 resembling the C++ Standard Template Library (STL). Thrust provides a
 flexible high-level interface for GPU programming":
 http://code.google.com/p/thrust/
  Something like this (but OpenCL) for D sounds quite interesting.

Hopefully OpenCL's runtime will be compatible to D's: Chris R Miller wrote (in Feb): > I looked into writing CUDA with D a while back. The problem is that the > CUDA C runtime and the D runtime are 100% incompatible. I don't have any new information about the topic though. Maybe it works with druntime.

Yeah, OpenCL looks interesting. For example, they annotate variables with either __global, __local or __private attributes, that are very close to D2 shared/TLS/unique.

Well, that's not quite right, global : shared, accessible by the host local : restricted to a 'work-group', not accessible by the host private: value-types on the function's stack
May 29 2009