# Swift to GPU/PTX

**URL:** <https://forums.swift.org/t/swift-to-gpu-ptx/50737>\
**Category:** Using Swift\
**Tags:** gpu, ptx\
**Created:** [July 29, 2021, 8:18am UTC](https://forums.swift.org/t/swift-to-gpu-ptx/50737 "2021-07-29T08:18:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gonsolo](https://avatars.discourse-cdn.com/v4/letter/g/3e96dc/32.png) [@gonsolo](https://forums.swift.org/u/gonsolo)\
**Post date:** [July 29, 2021, 8:18am UTC](https://forums.swift.org/t/swift-to-gpu-ptx/50737/1 "2021-07-29T08:18:33Z")

</div>

Is there a way to compile Swift to [PTX](https://docs.nvidia.com/cuda/parallel-thread-execution/index.html)?

I know about [Swift for Tensorflow](https://www.tensorflow.org/swift/guide/overview) and [SwiftRT](https://github.com/ewconnell/swiftrt) but they seem not to be quite exactly what I'm looking for.

My preferred way (other than a GPUSwift compiler) would be to manually emit IR, fiddle around with LLVM/MLIR tools and link by hand. Is this possible?
