-
Notifications
You must be signed in to change notification settings - Fork 395
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: avoid linking icicle dependent files when tag not provided (#1352)
Co-authored-by: Jeremy Felder <[email protected]>
- Loading branch information
1 parent
2945fbc
commit 627dc59
Showing
10 changed files
with
558 additions
and
259 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,31 @@ | ||
//go:build icicle | ||
|
||
package icicle | ||
|
||
import ( | ||
"fmt" | ||
"sync" | ||
|
||
"github.com/consensys/gnark/logger" | ||
icicle_runtime "github.com/ingonyama-zk/icicle/v3/wrappers/golang/runtime" | ||
) | ||
|
||
var onceWarmUpDevice sync.Once | ||
|
||
func warmUpDevice() { | ||
onceWarmUpDevice.Do(func() { | ||
log := logger.Logger() | ||
err := icicle_runtime.LoadBackendFromEnvOrDefault() | ||
if err != icicle_runtime.Success { | ||
panic(fmt.Sprintf("ICICLE backend loading error: %s", err.AsString())) | ||
} | ||
device := icicle_runtime.CreateDevice("CUDA", 0) | ||
log.Debug().Int32("id", device.Id).Str("type", device.GetDeviceType()).Msg("ICICLE device created") | ||
icicle_runtime.RunOnDevice(&device, func(args ...any) { | ||
err := icicle_runtime.WarmUpDevice() | ||
if err != icicle_runtime.Success { | ||
panic(fmt.Sprintf("ICICLE device warmup error: %s", err.AsString())) | ||
} | ||
}) | ||
}) | ||
} |
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 |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// Package icicle_bn254 implements ICICLE acceleration for BN254 Groth16 backend. | ||
package icicle_bn254 | ||
package icicle |
Oops, something went wrong.