tilework-cuda 0.18.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/ext/tilework/cuda/bridge.cpp +1236 -0
- data/ext/tilework/cuda/extconf.rb +105 -0
- data/ext/tilework/cuda/gpu_bridge.c +840 -0
- data/lib/tilework/backend/cuda.rb +32 -0
- metadata +66 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Activates the CUDA backend when `Tilework.backend = :cuda` is selected.
|
|
4
|
+
#
|
|
5
|
+
# @note Raises {Tilework::DeviceError} when the native extension or CUDA Toolkit is unavailable.
|
|
6
|
+
#
|
|
7
|
+
# `Tilework.backend = :cuda` requires this conventional path
|
|
8
|
+
# (tilework/backend/<name>). If this file itself is missing, the gem is not
|
|
9
|
+
# installed and tilework.rb turns the LoadError into a DeviceError. A failure
|
|
10
|
+
# past this point means the gem is installed but the extension was not built,
|
|
11
|
+
# a different situation, so it is raised as its own DeviceError rather than
|
|
12
|
+
# a bare LoadError.
|
|
13
|
+
begin
|
|
14
|
+
require "tilework/cuda/bridge"
|
|
15
|
+
rescue LoadError => e
|
|
16
|
+
raise Tilework::DeviceError,
|
|
17
|
+
"failed to load the CUDA bridge (is the native extension built? run `rake compile` " \
|
|
18
|
+
"in the tilework-cuda gem; requires a CUDA Toolkit — see CUDA_HOME): #{e.message}"
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
Tilework.register_backend(:cuda, Tilework::CUDABridge)
|
|
22
|
+
|
|
23
|
+
module Tilework::CUDABridge
|
|
24
|
+
def self.gemm_supported_dtypes
|
|
25
|
+
dtypes = %i[float32 float16]
|
|
26
|
+
probe = respond_to?(:device_capabilities) && device_capabilities
|
|
27
|
+
dtypes << :bfloat16 if probe && probe[:compute_capability]&.first.to_i >= 8
|
|
28
|
+
dtypes
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
def self.conv_supported_dtypes = gemm_supported_dtypes
|
|
32
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: tilework-cuda
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.18.4
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Kihaya Sugiura
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-11-16 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: tilework
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - "~>"
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: 0.18.0
|
|
20
|
+
type: :runtime
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - "~>"
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 0.18.0
|
|
27
|
+
description: 'The CUDA backend gem for tilework: the native extension (ext/tilework/cuda,
|
|
28
|
+
CUDA Driver API + NVRTC host C++). Depends on the tilework core gem for Buffer/Kernel/DSL/Ops
|
|
29
|
+
and the compat/cuda.h dialect header.'
|
|
30
|
+
email:
|
|
31
|
+
- kihayas@gmail.com
|
|
32
|
+
executables: []
|
|
33
|
+
extensions:
|
|
34
|
+
- ext/tilework/cuda/extconf.rb
|
|
35
|
+
extra_rdoc_files: []
|
|
36
|
+
files:
|
|
37
|
+
- LICENSE
|
|
38
|
+
- ext/tilework/cuda/bridge.cpp
|
|
39
|
+
- ext/tilework/cuda/extconf.rb
|
|
40
|
+
- ext/tilework/cuda/gpu_bridge.c
|
|
41
|
+
- lib/tilework/backend/cuda.rb
|
|
42
|
+
homepage: https://github.com/kihaya/tilework
|
|
43
|
+
licenses:
|
|
44
|
+
- MIT
|
|
45
|
+
metadata:
|
|
46
|
+
rubygems_mfa_required: 'true'
|
|
47
|
+
post_install_message:
|
|
48
|
+
rdoc_options: []
|
|
49
|
+
require_paths:
|
|
50
|
+
- lib
|
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - ">="
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '3.1'
|
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ">="
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
61
|
+
requirements: []
|
|
62
|
+
rubygems_version: 3.5.22
|
|
63
|
+
signing_key:
|
|
64
|
+
specification_version: 4
|
|
65
|
+
summary: CUDA backend for tilework
|
|
66
|
+
test_files: []
|