[GHC] #12573: Allow the user to pick the address that the RTS reserves for the heap
GHC
ghc-devs at haskell.org
Tue Sep 6 10:09:05 UTC 2016
#12573: Allow the user to pick the address that the RTS reserves for the heap
-------------------------------------+-------------------------------------
Reporter: bitonic | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 8.0.2
Component: Runtime System | Version: 8.0.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s):
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by tmcdonell):
@bitonic my current (partially working) solution is to use an
`__attribute__((constructor))` function to `mmap` the region that
CUDA/OpenCL requires before the RTS initialises. The RTS will then avoid
it and you can `munmap` it right before initialising CUDA/OpenCL:
https://github.com/tmcdonell/cuda/blob/hotfix/ghc-8/cbits/init.c
You can also initialise OpenCL directly in the constructor function, but
then you'll spin up the GPU many times during compilation/haddock (every
time a package loads your library). (This is simpler and what the master
branch of the above repo does, actually.)
Both those approaches work for compiled programs, but not in ghci, and I
haven't had a chance to dig to the bottom of it yet.
--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/12573#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the ghc-tickets
mailing list