Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion `originalLType->isStructTy()' failed #53

Open
mneilly opened this issue Mar 25, 2019 · 6 comments
Open

Assertion `originalLType->isStructTy()' failed #53

mneilly opened this issue Mar 25, 2019 · 6 comments

Comments

@mneilly
Copy link

mneilly commented Mar 25, 2019

I ran across dcompute and thought I would give it a try. What is the combination of dcompute and ldc that is expected to work? I have tried ldc 1.4.0 thru 1.15 with dcompute 0.1.0 and master and have not found a combination that works when I try "dub test dcompute".

Depending upon the combination I get different errors including:

../../../.dub/packages/dcompute-master/dcompute/source/dcompute/driver/error.d(165,43): Error: non-constant nested delegate literal expression __lambda9

../../../.dub/packages/dcompute-0.1.0/dcompute/source/dcompute/driver/error.d(143,13): Error: undefined identifier fprintf             
                                                                             
../../../.dub/packages/dcompute-0.1.0/dcompute/source/dcompute/driver/ocl/context.d(144,19): Error: undefined identifier clCreateProgramWithIL 

master/dcompute/source/dcompute/tests/main.d(106): Enforcement failed                            

ldc2: /home/vsts/work/1/s/gen/abi-x86-64.cpp:303: void X86_64TargetABI::rewriteArgument(IrFuncTy&, IrFuncTyArg&, {anonymous}::RegCount&): Assertion `originalLType->isStructTy()' failed.                                                                                        

/usr/local/ldc2-1.13.0-beta2-linux-x86_64/bin/../import/std/array.d(2975,13): Error: TypeInfo cannot be used with -betterC
@thewilsonator
Copy link
Collaborator

Try with the latest LDC beta.

@mneilly
Copy link
Author

mneilly commented Mar 25, 2019

Unfortunately, I cannot get that to work either as it gets the 'enforcement failed error'.

(ldc-1.15.0-beta2)$ dub test dcompute --compiler=ldc2
Building package dcompute in /home/mneilly/.dub/packages/dcompute-master/dcompute/
Executable configuration "unittest" of package dcompute defines no main source file, this may cause certain build modes to fail. Add an explicit "mainSourceFile" to the package description to fix this.
Running custom 'unittest' configuration.
Performing "unittest" build using ldc2 for x86_64.
derelict-util 3.0.0-beta.2: building configuration "library"...
derelict-cl 3.2.0: building configuration "library"...
derelict-cuda 3.1.1: building configuration "library"...
taggedalgebraic 0.10.13: target for configuration "library" is up to date.
dcompute ~master: building configuration "unittest"...
To force a rebuild of up-to-date targets, run again with --force.
Running ../../../.dub/packages/dcompute-master/dcompute/dcompute 
object.Exception@../../../.dub/packages/dcompute-master/dcompute/source/dcompute/tests/main.d(106): Enforcement failed
----------------
??:? [0x55b341cfea80]
??:? [0x55b341d08d3a]
??:? [0x55b341cf026d]
exception.d:516 [0x55b341cba4a0]
exception.d:436 [0x55b341ca9465]
main.d:106 [0x55b341ca8a79]
??:? [0x55b341cefeef]
??:? [0x55b341cefde7]
__entrypoint.d:8 [0x55b341caa5d4]
??:? __libc_start_main [0x7f78136f42e0]
??:? [0x55b341ca8219]
Program exited with code 1

@thewilsonator
Copy link
Collaborator

You appear to be using OpenCL, which means that you need to figure out which device (if any) supports OpenCL 2.1 (for me that is the Intel experimental CPU) and adjust https://github.com/libmir/dcompute/blob/master/source/dcompute/tests/main.d#L24 to match whatever index that device is. I insulated the Nvidia 1.2 before the intel ones so that is index zero, then the intel 1.2 one is index one and the experimental 2.1 device is index 2.

@mneilly
Copy link
Author

mneilly commented Mar 25, 2019

Thanks for the responses (and the creation of dcompute!). :)

I'm not intending to use CL. I see version = DComputeTestCUDA; at the top of ~/.dub/packages/dcompute-master/dcompute/source/dcompute/tests/ and I see that .dub/obj/kernels_cuda210_64.ptx was created...

If I comment out the enforce I see that res[] is all zero.

@thewilsonator
Copy link
Collaborator

Hmm, I'll have to look into that then.

@thewilsonator
Copy link
Collaborator

This may have been fixed by ldc-developers/ldc#3251

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants