Jump to page: 1 2
Thread overview
Need importing dcompute.lib into my project
Oct 13
jmh530
Oct 07
kinke
October 06
Hi,

I have a cuda kernel already working in my cpp project(https://github.com/kerdemdemir/CUDABeamformer/blob/master/CudaBeamformer/kernel.cu)

I am trying to convert this to D with using DCompute. I already compiled the DCompute source code and have dcompute.lib. But I am really not good with using libraries and don't know how to use DCompute in my D project(https://github.com/kerdemdemir/DSharpEar/tree/master/DSharpEar). I am not using DUB and compiling with VisualD.

Can you guys please help with importing DCompute into my project?

Regards
Erdem

October 06
On Friday, 6 October 2017 at 18:12:43 UTC, kerdemdemir wrote:
> Hi,
>
> I have a cuda kernel already working in my cpp project(https://github.com/kerdemdemir/CUDABeamformer/blob/master/CudaBeamformer/kernel.cu)
>
> I am trying to convert this to D with using DCompute. I already compiled the DCompute source code and have dcompute.lib. But I am really not good with using libraries and don't know how to use DCompute in my D project(https://github.com/kerdemdemir/DSharpEar/tree/master/DSharpEar). I am not using DUB and compiling with VisualD.
>
> Can you guys please help with importing DCompute into my project?
>
> Regards
> Erdem

You should add DCompute as a DUB dependancy.
October 07
> You should add DCompute as a DUB dependancy.

Hi,

I inited my project with Dub by unsing  "dub init DSharpEar" and I added dependency "dcompute".

Even I give extra parameters for using ldc.

 dub build --compiler=D:\LDCDownload\bin\ldc2.exe --force

I am getting :

Error: static assert  "Need to use a DCompute enabled compiler"

Any suggestions?

Regards
Erdem
October 07
On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote:
>> You should add DCompute as a DUB dependancy.
>
> Hi,
>
> I inited my project with Dub by unsing  "dub init DSharpEar" and I added dependency "dcompute".
>
> Even I give extra parameters for using ldc.
>
>  dub build --compiler=D:\LDCDownload\bin\ldc2.exe --force
>
> I am getting :
>
> Error: static assert  "Need to use a DCompute enabled compiler"
>
> Any suggestions?
>
> Regards
> Erdem

do you set "-mdcompute-targets=cuda-xxx" in the dflags for your dub.json for your project?
October 07
> do you set "-mdcompute-targets=cuda-xxx" in the dflags for your dub.json for your project?

I have added now after your comment.

But it seems it didn't changed anything.

Here is the dub.json file I have:
{
	"name": "dsharpear",
	"authors": [
		"Erdem"
	],
	"dflags" : ["-mdcompute-targets=cuda-210" ,"-oq", "-betterC"],
	"dependencies": {
		"dcompute": ">=0.0.0-alpha0 <0.1.0"
	},
	"description": "Beamforming with D ",
	"copyright": "Copyright © 2017, Erdem",
	"license": "proprietary"
}

And running "dub build --compiler=D:\LDCDownload\bin\ldc2.exe --force"  fails with:

Performing "debug" build using D:\LDCDownload\bin\ldc2.exe for x86.
derelict-util 2.1.0: building configuration "library"...
derelict-cl 2.0.0: building configuration "library"...
derelict-cuda 2.0.1: building configuration "library"...
..\..\..\..\..\AppData\Roaming\dub\packages\derelict-cuda-2.0.1\derelict-cuda\source\derelict\cuda\runtimeapi.d(816,5): Deprecation: constructor derelict.cuda.runtimeapi.dim3.this
all parameters have default arguments, but structs cannot have default constructors.
dcompute 0.0.0-alpha0: building configuration "library"...
Targeting 'i686-pc-windows-msvc' (CPU 'pentium4' with features '')
Building type: real
Building type: uint
Building type: char
Building type: ubyte
Building type: ulong
Building type: int
Building type: double
Building type: long
Building type: ushort
Building type: wchar
Building type: byte
Building type: short
Building type: float
Building type: dchar
..\..\..\..\..\AppData\Roaming\dub\packages\dcompute-0.0.0-alpha0\dcompute\source\dcompute\std\package.d(6,5): Error: static assert  "Need to use a DCompute enabled compiler
See https://github.com/thewilsonator/ldc/tree/dcompute"
D:\LDCDownload\bin\ldc2.exe failed with exit code 1.
October 07
On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote:
> Error: static assert  "Need to use a DCompute enabled compiler"

Are you using latest LDC 1.4? The CUDA backend wasn't enabled for earlier versions.
October 07
On Saturday, 7 October 2017 at 12:12:10 UTC, kinke wrote:
> On Saturday, 7 October 2017 at 09:04:26 UTC, kerdemdemir wrote:
>> Error: static assert  "Need to use a DCompute enabled compiler"
>
> Are you using latest LDC 1.4? The CUDA backend wasn't enabled for earlier versions.

Yes I am. Actually I can build dcompute's source code so I am sure LDC version is good. Now I am trying to use dcompute within my project.
October 08
On Saturday, 7 October 2017 at 10:34:15 UTC, kerdemdemir wrote:
>> do you set "-mdcompute-targets=cuda-xxx" in the dflags for your dub.json for your project?
>
> I have added now after your comment.
>
> But it seems it didn't changed anything.
>
> Here is the dub.json file I have:
> {
> 	"name": "dsharpear",
> 	"authors": [
> 		"Erdem"
> 	],
> 	"dflags" : ["-mdcompute-targets=cuda-210" ,"-oq", "-betterC"],
> 	"dependencies": {
> 		"dcompute": ">=0.0.0-alpha0 <0.1.0"
> 	},
> 	"description": "Beamforming with D ",
> 	"copyright": "Copyright © 2017, Erdem",
> 	"license": "proprietary"
> }
>
> And running "dub build --compiler=D:\LDCDownload\bin\ldc2.exe --force"  fails with:
>
> Performing "debug" build using D:\LDCDownload\bin\ldc2.exe for x86.
> derelict-util 2.1.0: building configuration "library"...
> derelict-cl 2.0.0: building configuration "library"...
> derelict-cuda 2.0.1: building configuration "library"...
> ..\..\..\..\..\AppData\Roaming\dub\packages\derelict-cuda-2.0.1\derelict-cuda\source\derelict\cuda\runtimeapi.d(816,5): Deprecation: constructor derelict.cuda.runtimeapi.dim3.this
> all parameters have default arguments, but structs cannot have default constructors.
> dcompute 0.0.0-alpha0: building configuration "library"...
> Targeting 'i686-pc-windows-msvc' (CPU 'pentium4' with features '')
> Building type: real
> Building type: uint
> Building type: char
> Building type: ubyte
> Building type: ulong
> Building type: int
> Building type: double
> Building type: long
> Building type: ushort
> Building type: wchar
> Building type: byte
> Building type: short
> Building type: float
> Building type: dchar
> ..\..\..\..\..\AppData\Roaming\dub\packages\dcompute-0.0.0-alpha0\dcompute\source\dcompute\std\package.d(6,5): Error: static assert  "Need to use a DCompute enabled compiler
> See https://github.com/thewilsonator/ldc/tree/dcompute"
> D:\LDCDownload\bin\ldc2.exe failed with exit code 1.

You are using an old DCompute: that message was changed in https://github.com/libmir/dcompute/commit/cf1420d5377c48f9132f1a9a0f8f06ebb46a6433#diff-b0637c2cde07f2ec8f77f9e3d379fff7

I'm not quite sure how the dub version specs work but I believe "dcompute": "~>0.0.0" should work, or you can force it to use master.
I'm still not sure why it fails with that error though, are you using an old LDC as well? 1.4.0 should work.
October 13
On Sunday, 8 October 2017 at 07:51:12 UTC, Nicholas Wilson wrote:
> On Saturday, 7 October 2017 at 10:34:15 UTC, kerdemdemir wrote:
>>> do you set "-mdcompute-targets=cuda-xxx" in the dflags for your dub.json for your project?
>>
>> I have added now after your comment.
>>
>> But it seems it didn't changed anything.
>>
>> Here is the dub.json file I have:
>> {
>> 	"name": "dsharpear",
>> 	"authors": [
>> 		"Erdem"
>> 	],
>> 	"dflags" : ["-mdcompute-targets=cuda-210" ,"-oq", "-betterC"],
>> 	"dependencies": {
>> 		"dcompute": ">=0.0.0-alpha0 <0.1.0"
>> 	},
>> 	"description": "Beamforming with D ",
>> 	"copyright": "Copyright © 2017, Erdem",
>> 	"license": "proprietary"
>> }
>>
>> And running "dub build --compiler=D:\LDCDownload\bin\ldc2.exe --force"  fails with:
>>
>> Performing "debug" build using D:\LDCDownload\bin\ldc2.exe for x86.
>> derelict-util 2.1.0: building configuration "library"...
>> derelict-cl 2.0.0: building configuration "library"...
>> derelict-cuda 2.0.1: building configuration "library"...
>> ..\..\..\..\..\AppData\Roaming\dub\packages\derelict-cuda-2.0.1\derelict-cuda\source\derelict\cuda\runtimeapi.d(816,5): Deprecation: constructor derelict.cuda.runtimeapi.dim3.this
>> all parameters have default arguments, but structs cannot have default constructors.
>> dcompute 0.0.0-alpha0: building configuration "library"...
>> Targeting 'i686-pc-windows-msvc' (CPU 'pentium4' with features '')
>> Building type: real
>> Building type: uint
>> Building type: char
>> Building type: ubyte
>> Building type: ulong
>> Building type: int
>> Building type: double
>> Building type: long
>> Building type: ushort
>> Building type: wchar
>> Building type: byte
>> Building type: short
>> Building type: float
>> Building type: dchar
>> ..\..\..\..\..\AppData\Roaming\dub\packages\dcompute-0.0.0-alpha0\dcompute\source\dcompute\std\package.d(6,5): Error: static assert  "Need to use a DCompute enabled compiler
>> See https://github.com/thewilsonator/ldc/tree/dcompute"
>> D:\LDCDownload\bin\ldc2.exe failed with exit code 1.
>
> You are using an old DCompute: that message was changed in https://github.com/libmir/dcompute/commit/cf1420d5377c48f9132f1a9a0f8f06ebb46a6433#diff-b0637c2cde07f2ec8f77f9e3d379fff7
>
> I'm not quite sure how the dub version specs work but I believe "dcompute": "~>0.0.0" should work, or you can force it to use master.
> I'm still not sure why it fails with that error though, are you using an old LDC as well? 1.4.0 should work.

I changed my dependency setting in dub file to "dcompute": "~>0.0.0" but still getting the same error message. By the way I am sure my LDC version is good because I can build DCompute source code with same LDC version.
October 13
On 10/13/2017 08:47 AM, kerdemdemir wrote:

> I changed my dependency setting in dub file to "dcompute": "~>0.0.0" but
> still getting the same error message. By the way I am sure my LDC
> version is good because I can build DCompute source code with same LDC
> version.

Could this be related to difference in platform like Windows vs. Linux? If so, may be it makes sense to work in a VM that has Nicholas's exact setup.

Ali

« First   ‹ Prev
1 2