Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
server
Manage
Activity
Members
Labels
Automate
Agent sessions
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elixxir
server
Commits
a6ce0ee3
Commit
a6ce0ee3
authored
Apr 23, 2019
by
Tigran Avakyan
Browse files
Options
Downloads
Patches
Plain Diff
Ran go lint on graphs
parent
8ecc5c71
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
graphs/initializer.go
+1
-0
1 addition, 0 deletions
graphs/initializer.go
graphs/permute.go
+7
-3
7 additions, 3 deletions
graphs/permute.go
with
8 additions
and
3 deletions
graphs/initializer.go
+
1
−
0
View file @
a6ce0ee3
...
@@ -8,4 +8,5 @@ package graphs
...
@@ -8,4 +8,5 @@ package graphs
import
"gitlab.com/elixxir/server/services"
import
"gitlab.com/elixxir/server/services"
// Initializer is the function type signature for how all graphs should be initialized
type
Initializer
func
(
gc
services
.
GraphGenerator
)
*
services
.
Graph
type
Initializer
func
(
gc
services
.
GraphGenerator
)
*
services
.
Graph
This diff is collapsed.
Click to expand it.
graphs/permute.go
+
7
−
3
View file @
a6ce0ee3
...
@@ -12,11 +12,13 @@ import (
...
@@ -12,11 +12,13 @@ import (
"gitlab.com/elixxir/server/services"
"gitlab.com/elixxir/server/services"
)
)
// PermuteIO used to convert input and output when streams are linked
type
PermuteIO
struct
{
type
PermuteIO
struct
{
Input
*
cyclic
.
IntBuffer
Input
*
cyclic
.
IntBuffer
Output
[]
*
cyclic
.
Int
Output
[]
*
cyclic
.
Int
}
}
// PermuteSubStream is used to store input and outputs slices for permutation
type
PermuteSubStream
struct
{
type
PermuteSubStream
struct
{
// Populate during Link
// Populate during Link
permutations
[]
uint32
permutations
[]
uint32
...
@@ -26,6 +28,7 @@ type PermuteSubStream struct {
...
@@ -26,6 +28,7 @@ type PermuteSubStream struct {
outputs
[][]
*
cyclic
.
Int
outputs
[][]
*
cyclic
.
Int
}
}
// LinkStreams sets array of permutations slice references and appends each permute io from list into substream
func
(
pss
*
PermuteSubStream
)
LinkStreams
(
expandedBatchSize
uint32
,
permutation
[]
uint32
,
ioLst
...
PermuteIO
)
{
func
(
pss
*
PermuteSubStream
)
LinkStreams
(
expandedBatchSize
uint32
,
permutation
[]
uint32
,
ioLst
...
PermuteIO
)
{
pss
.
permutations
=
permutation
pss
.
permutations
=
permutation
...
@@ -43,6 +46,7 @@ func (pss *PermuteSubStream) getSubStream() *PermuteSubStream {
...
@@ -43,6 +46,7 @@ func (pss *PermuteSubStream) getSubStream() *PermuteSubStream {
return
pss
return
pss
}
}
// Permute module implements slot permutations on Adapt and conforms to module interface using a dummy cryptop
var
Permute
=
services
.
Module
{
var
Permute
=
services
.
Module
{
Adapt
:
func
(
stream
services
.
Stream
,
cryptop
cryptops
.
Cryptop
,
chunk
services
.
Chunk
)
error
{
Adapt
:
func
(
stream
services
.
Stream
,
cryptop
cryptops
.
Cryptop
,
chunk
services
.
Chunk
)
error
{
ps
,
ok
:=
stream
.
(
permuteSubStreamInterface
)
ps
,
ok
:=
stream
.
(
permuteSubStreamInterface
)
...
@@ -69,7 +73,7 @@ var Permute = services.Module{
...
@@ -69,7 +73,7 @@ var Permute = services.Module{
NumThreads
:
4
,
NumThreads
:
4
,
}
}
/*
d
ummy cryptop for testing*/
/*
D
ummy cryptop for testing*/
type
permuteDummyCryptopPrototype
func
()
type
permuteDummyCryptopPrototype
func
()
var
permuteDummyCryptop
permuteDummyCryptopPrototype
=
func
()
{
return
}
var
permuteDummyCryptop
permuteDummyCryptopPrototype
=
func
()
{
return
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment