Jonathan Ragan-Kelley
2012-Sep-14 23:53 UTC
[LLVMdev] Atomic ops cannot be built from C/OCaml bindings
Forgive me if I'm missing something obvious, but it seems that a number of core instructions—I'm specifically running in to `atomicrmw`, `fence`, and `cmpxchg` at the moment—cannot be constructed from the C bindings, and are therefore also inaccessible to the OCaml bindings. There are opcodes for each of these in the llvm-c/Core.h, but there seems to be no way to construct them. Is there a reason these should be omitted? (I am currently running into this trying to use NVPTX, where CUDA atomics are largely built from the native atomic instructions, in a compiler written in OCaml.) Thanks.
Eric Christopher
2012-Sep-15 00:05 UTC
[LLVMdev] Atomic ops cannot be built from C/OCaml bindings
On Sep 14, 2012, at 4:53 PM, Jonathan Ragan-Kelley <jrk at csail.mit.edu> wrote:> Is there a reason these should be omitted?Not in particular. Things are added to the C API as needed and usually on demand. -eric
Jonathan Ragan-Kelley
2012-Oct-05 02:13 UTC
[LLVMdev] Atomic ops cannot be built from C/OCaml bindings
How soon would I need to submit a patch for this for it to have a comfortable shot at making it into the 3.2 release? On Sep 14, 2012, at 8:05 PM, Eric Christopher <echristo at apple.com> wrote:> > On Sep 14, 2012, at 4:53 PM, Jonathan Ragan-Kelley <jrk at csail.mit.edu> wrote: > >> Is there a reason these should be omitted? > > Not in particular. Things are added to the C API as needed and usually on demand. > > -eric
Jonathan Ragan-Kelley
2012-Oct-24 20:02 UTC
[LLVMdev] Atomic ops cannot be built from C/OCaml bindings
I finally got around to adding these. The patch is posted in a pull request on my copy of llvm.git: https://github.com/jrk/llvm/pull/3 and a simple test with OCaml is here: https://gist.github.com/3948460 Feedback welcome. On Sep 14, 2012, at 7:53 PM, Jonathan Ragan-Kelley <jrk at csail.mit.edu> wrote:> Forgive me if I'm missing something obvious, but it seems that a > number of core instructions—I'm specifically running in to > `atomicrmw`, `fence`, and `cmpxchg` at the moment—cannot be > constructed from the C bindings, and are therefore also inaccessible > to the OCaml bindings. There are opcodes for each of these in the > llvm-c/Core.h, but there seems to be no way to construct them. > > Is there a reason these should be omitted? > > (I am currently running into this trying to use NVPTX, where CUDA > atomics are largely built from the native atomic instructions, in a > compiler written in OCaml.) > > Thanks.
Jonathan Ragan-Kelley
2012-Nov-02 17:38 UTC
[LLVMdev] Atomic ops cannot be built from C/OCaml bindings
Take two, since I didn't hear anything last time I posted about this. I have rebased the patch onto the trunk as of a few minutes ago and am attaching it here as a patch. I'd really like to see this go in before 3.2. test_llvm_atom.ml is a standalone OCaml program which uses the new interface to generate a bunch of atomic ops. It need not be included in the repository, I'm just adding it here to help anyone who wants to sanity check the bindings. Thanks! On Wed, Oct 24, 2012 at 4:02 PM, Jonathan Ragan-Kelley <jrk at csail.mit.edu> wrote:> I finally got around to adding these. > > The patch is posted in a pull request on my copy of llvm.git: > > https://github.com/jrk/llvm/pull/3 > > and a simple test with OCaml is here: > > https://gist.github.com/3948460 > > Feedback welcome. > > On Sep 14, 2012, at 7:53 PM, Jonathan Ragan-Kelley <jrk at csail.mit.edu> wrote: > >> Forgive me if I'm missing something obvious, but it seems that a >> number of core instructions—I'm specifically running in to >> `atomicrmw`, `fence`, and `cmpxchg` at the moment—cannot be >> constructed from the C bindings, and are therefore also inaccessible >> to the OCaml bindings. There are opcodes for each of these in the >> llvm-c/Core.h, but there seems to be no way to construct them. >> >> Is there a reason these should be omitted? >> >> (I am currently running into this trying to use NVPTX, where CUDA >> atomics are largely built from the native atomic instructions, in a >> compiler written in OCaml.) >> >> Thanks. >-------------- next part -------------- A non-text attachment was scrubbed... Name: 0001-Add-atomicrmw-cmpxchg-to-llvm-c-OCaml-interfaces.patch Type: application/octet-stream Size: 8147 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121102/e1479ebf/attachment.obj> -------------- next part -------------- A non-text attachment was scrubbed... Name: test_llvm_atom.ml Type: application/octet-stream Size: 2505 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121102/e1479ebf/attachment-0001.obj>
Maybe Matching Threads
- [LLVMdev] Atomic ops cannot be built from C/OCaml bindings
- [LLVMdev] Atomic ops cannot be built from C/OCaml bindings
- [LLVMdev] Atomic ops cannot be built from C/OCaml bindings
- [LLVMdev] Does the OCaml binding include intrinsic support?
- [LLVMdev] PTX backend support for atomics