Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
877254f4
Commit
877254f4
authored
Apr 13, 2018
by
Tianqi Chen
Committed by
GitHub
Apr 13, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix metal backward compatibility (#1105)
parent
ce02ee3b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
src/runtime/metal/metal_module.mm
+5
-2
tests/python/integration/test_ewise.py
+3
-2
No files found.
src/runtime/metal/metal_module.mm
View file @
877254f4
...
@@ -83,8 +83,11 @@ class MetalModuleNode final :public runtime::ModuleNode {
...
@@ -83,8 +83,11 @@ class MetalModuleNode final :public runtime::ModuleNode {
if (e.lib == nil) {
if (e.lib == nil) {
if (fmt_ == "metal") {
if (fmt_ == "metal") {
MTLCompileOptions *opts = [MTLCompileOptions alloc];
MTLCompileOptions *opts = [MTLCompileOptions alloc];
opts.languageVersion = MTLLanguageVersion2_0;
// Use the default setting for now.
opts.fastMathEnabled = YES;
// by default most recent version is used.
// opts.languageVersion = MTLLanguageVersion2_0;
// opts.fastMathEnabled = YES;
opts = nil;
e.lib = [
e.lib = [
w->devices[device_id]
w->devices[device_id]
newLibraryWithSource:[NSString stringWithUTF8String:data_.c_str()]
newLibraryWithSource:[NSString stringWithUTF8String:data_.c_str()]
...
...
tests/python/integration/test_ewise.py
View file @
877254f4
...
@@ -98,8 +98,8 @@ def test_popcount():
...
@@ -98,8 +98,8 @@ def test_popcount():
check_device
(
"llvm"
)
check_device
(
"llvm"
)
check_device
(
"cuda"
)
check_device
(
"cuda"
)
check_device
(
"opencl"
)
check_device
(
"opencl"
)
check_device
(
"metal"
)
if
dtype
==
"uint32"
:
if
dtype
==
"uint32"
:
check_device
(
"metal"
)
check_device
(
"vulkan"
)
check_device
(
"vulkan"
)
run
(
'uint32'
)
run
(
'uint32'
)
run
(
'uint64'
)
run
(
'uint64'
)
...
@@ -146,8 +146,9 @@ def test_add():
...
@@ -146,8 +146,9 @@ def test_add():
c
.
asnumpy
(),
a
.
asnumpy
()
+
b
.
asnumpy
(),
rtol
=
1e-6
)
c
.
asnumpy
(),
a
.
asnumpy
()
+
b
.
asnumpy
(),
rtol
=
1e-6
)
check_device
(
"opencl"
)
check_device
(
"opencl"
)
check_device
(
"metal"
)
check_device
(
"cuda"
)
check_device
(
"cuda"
)
if
dtype
==
"float32"
:
check_device
(
"metal"
)
check_device
(
"vulkan"
)
check_device
(
"vulkan"
)
run
(
"float32"
)
run
(
"float32"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment