swift-lang / swift-t

Swift/T: High Performance Parallel Scripting Language
http://swift-lang.org/Swift-T
Apache License 2.0
53 stars 22 forks source link

Calling conventions Swift/T -> C #43

Open j-woz opened 9 years ago

j-woz commented 9 years ago

From @GoogleCodeExporter on April 22, 2015 19:2

We need to define calling conventions for calling C functions with Swift/T 
data.  I'm enumerating some of the initial issues that I can think of.

+-------------------------+
| Function signatures     |
+-------------------------+
- Do we want to pass in any additional metadata arguments?  E.g. Swift/T state, 
MPI communicators, etc
- C input arguments match Swift/T input arguments
- How to support multiple outputs?
  -> Ideally single outputs can be handled as return value
- How to support varargs??

+-------------------------+
| Data types              |
+-------------------------+
Scalar/simple types
- numeric types -> native ADLB representation (int64_t, double, etc)
- strings -> null-terminated

Uninterpreted data
- blob -> struct? or two arguments?

Composite types
- Arrays (sparse) -> ???
- Structs -> ???

+-------------------------+
| Options                 |
+-------------------------+
1. Pass native ADLB representations into C function
2. Unpacked representations based (loosely?) on SWIG conventions
3. Unpacked representations not based on SWIG

Original issue reported on code.google.com by tim.g.ar...@gmail.com on 2 May 2014 at 7:25

Copied from original issue: jmjwozniak/exm-issues#682

j-woz commented 9 years ago

From @GoogleCodeExporter on April 22, 2015 19:2

Issue 622 has been merged into this issue.

Original comment by tim.g.ar...@gmail.com on 22 May 2014 at 10:06

j-woz commented 9 years ago

From @GoogleCodeExporter on April 22, 2015 19:2

Issue 349 has been merged into this issue.

Original comment by tim.g.ar...@gmail.com on 22 May 2014 at 10:07