-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create cuda context once for all cuda tests
All cuda tests succeed, even with go version 1.10 or higher. This commit solves issue mumax#224
- Loading branch information
1 parent
2cf5c9a
commit 71b1016
Showing
4 changed files
with
12 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package cuda | ||
|
||
import ( | ||
"github.com/mumax/3/cuda/cu" | ||
) | ||
|
||
// needed for all other tests. | ||
func init() { | ||
cu.Init(0) | ||
ctx := cu.CtxCreate(cu.CTX_SCHED_AUTO, 0) | ||
cu.CtxSetCurrent(ctx) | ||
} |
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 |
---|---|---|
|
@@ -12,7 +12,6 @@ import ( | |
var in1, in2, in3 *data.Slice | ||
|
||
func initTest() { | ||
Init(0) | ||
if in1 != nil { | ||
return | ||
} | ||
|
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