-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* nvidia: update hello world following changes in #456 * update Nvidia backend to use the new LLVM infra * update Nvidia multiplication
- Loading branch information
Showing
11 changed files
with
437 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Constantine | ||
# Copyright (c) 2018-2019 Status Research & Development GmbH | ||
# Copyright (c) 2020-Present Mamy André-Ratsimbazafy | ||
# Licensed and distributed under either of | ||
# * MIT license (license terms in the root directory or at http://opensource.org/licenses/MIT). | ||
# * Apache v2 license (license terms in the root directory or at http://www.apache.org/licenses/LICENSE-2.0). | ||
# at your option. This file may not be copied, modified, or distributed except according to those terms. | ||
|
||
import | ||
constantine/platforms/llvm/llvm, | ||
./ir, | ||
./impl_fields_sat {.all.}, | ||
./impl_fields_nvidia {.all.} | ||
|
||
proc modadd*(asy: Assembler_LLVM, fd: FieldDescriptor, r, a, b, M: ValueRef) = | ||
case asy.backend | ||
of {bkX86_64_Linux, bkAmdGpu}: | ||
asy.modadd_sat(fd, r, a, b, M) | ||
of bkNvidiaPTX: | ||
asy.modadd_nvidia(fd, r, a, b, M) | ||
|
||
proc modsub*(asy: Assembler_LLVM, fd: FieldDescriptor, r, a, b, M: ValueRef) = | ||
case asy.backend | ||
of bkNvidiaPTX: | ||
asy.modsub_nvidia(fd, r, a, b, M) | ||
else: | ||
doAssert false, "Unimplemented" | ||
|
||
proc mtymul*(asy: Assembler_LLVM, fd: FieldDescriptor, r, a, b, M: ValueRef) = | ||
case asy.backend | ||
of bkNvidiaPTX: | ||
asy.mtymul_nvidia(fd, r, a, b, M) | ||
else: | ||
doAssert false, "Unimplemented" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.