Modify

Opened 5 years ago

Closed 5 years ago

#1634 closed defect (fixed)

CUDA breaks CCTK_BUILTIN_UNREACHABLE

Reported by: Steven R. Brandt Owned by:
Priority: minor Milestone: Cactus_4.3.0
Component: Other Version: development version
Keywords: Cc:

Description

Code containing CCTK_BUILTIN_UNREACHABLE does not compile with CUDA. In fact, there seems to be problems with calling abort() from CUDA as well. The attached patch allows compilation to proceed, but I suspect it will be hated.

Attachments (2)

config.patch (1.0 KB) - added by Steven R. Brandt 5 years ago.
config.2.patch (773 bytes) - added by Steven R. Brandt 5 years ago.

Download all attachments as: .zip

Change History (7)

Changed 5 years ago by Steven R. Brandt

Attachment: config.patch added

comment:1 Changed 5 years ago by Erik Schnetter

(1) In the long run, CUDA should become its own language, and should stop pretending to be C or C++. In the short run, testing CUDACC is fine.

(2) Isn't CUDA like C++? If so, do you need to change the behaviour of C code?

(3) If asm("trap;") works always, then the macro should be always defined, and not only if C++ supports it.

comment:2 Changed 5 years ago by Steven R. Brandt

So, in answer to (1). I'm sorry for what CUDA is doing. :)

In answer to (3), I realized I had that wrong shortly after I submitted the patch. The new patch corrects both (2) and (3).

Changed 5 years ago by Steven R. Brandt

Attachment: config.2.patch added

comment:3 Changed 5 years ago by Erik Schnetter

Status: newreview

comment:4 Changed 5 years ago by Erik Schnetter

Status: reviewreviewed_ok

comment:5 Changed 5 years ago by Steven R. Brandt

Resolution: fixed
Status: reviewed_okclosed

Fixed in revision 5121

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.