Comments (6)
Note that all of this requires fairly minor changes to the compiler.
from futhark.
For a start, I changed the interpreter to use 32-bit signed integers internally.
from futhark.
real
has already become float32
and float64
. We could easily add float16
, which I believe is supported by some GPUs. I think byte
is a bad name, and we should use uint8
or word8
instead. As I recall, LLVM uses i32
for a signed 32-bit integer, and u32
for an unsigned 32-bit integer. This is also an okay name, but perhaps the succintness is excessive.
from futhark.
I will do this soon, as it is necessary to support some benchmarks (like Hashcat from Accelerate). For the internal language, I will most likely copy the LLVM type system: http://nondot.org/~sabre/LLVMNotes/TypeSystemChanges.txt and http://llvm.org/docs/LangRef.html#first-class-types
One interesting feature of the LLVM type system is that there is no distinction between unsigned and signed integer types. In LLVM, you use distinct instructions (like sdiv
versus udiv
) instead, which is really what you want in a IL anyway.
The external language will have distinguished signed/unsigned types, of course.
The only thing I need to figure out is how to express casts/conversions between the different types. There should of course be the three usual rounding functions from any floating point type to any integer type (and back), but we also need conversion functions between the integers - both sign-extending and zero-extending. And of course, these shouldn't really be "functions" in the internal language, but built-in constructs. I think they should look like functions in the external language, though.
from futhark.
Also, like C and LLVM (kind of), signed overflow will be undefined. This is mostly to help with range analysis, where x+1>x is a very nice property to have.
from futhark.
I did part of this. The only thing missing is to add unsigned types. I have come to the conclusion that I do not want automatic type coercion/conversion - it will be more verbose, but you will know what's going on.
from futhark.
Related Issues (20)
- Internal compiler error: Use of unknown variable HOT 1
- Internal compiler error: lmadcopyCPU: 0 HOT 1
- Platform inconsistency in power calculation HOT 6
- This should not type check
- Size-type error after pass `simplify` HOT 1
- Futhark does not run with GHC 9.8 HOT 2
- Internal compiler error: unknown variable HOT 1
- ispc backend failing on large ranges HOT 8
- Document `FUTHARK_COMPILER_DEBUGGING=2`.
- Limit context memory use HOT 4
- Internal compiler error
- Internal compiler error (unhandled IO exception).
- Dead repl link on front page HOT 1
- Justification for Alias Tracking HOT 1
- futhark c and multicore are giving different results HOT 3
- Module ascription does not type check
- Is it possible to add a compiled version of the windows version available for download? HOT 4
- Documentation improvement for Prelude math functions HOT 3
- Type suffixes should be ignored when unifying expressions
- Spurious variance in tensor contraction expression going into loop tiling HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from futhark.