From ea3235640bdcc1f0b802bb3491bfa9726cf179ae Mon Sep 17 00:00:00 2001 From: Hleb Albau Date: Thu, 22 Nov 2018 10:49:09 +0300 Subject: [PATCH] #74 Add rank calculation tracing. Fix cpu build --- cosmos/poc/app/rank/calculate_gpu_nop.go | 3 ++- cosmos/poc/app/rank/cuda/test_cpu_gpu_determinism.go | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/cosmos/poc/app/rank/calculate_gpu_nop.go b/cosmos/poc/app/rank/calculate_gpu_nop.go index be3497b1..88e1c990 100644 --- a/cosmos/poc/app/rank/calculate_gpu_nop.go +++ b/cosmos/poc/app/rank/calculate_gpu_nop.go @@ -4,8 +4,9 @@ package rank import ( . "github.com/cybercongress/cyberd/cosmos/poc/app/storage" + "github.com/tendermint/tendermint/libs/log" ) -func calculateRankGPU(data *InMemoryStorage) ([]float64, int) { +func calculateRankGPU(data *InMemoryStorage, logger log.Logger) ([]float64, int) { panic("Not Supported") } diff --git a/cosmos/poc/app/rank/cuda/test_cpu_gpu_determinism.go b/cosmos/poc/app/rank/cuda/test_cpu_gpu_determinism.go index fd055502..d664d285 100644 --- a/cosmos/poc/app/rank/cuda/test_cpu_gpu_determinism.go +++ b/cosmos/poc/app/rank/cuda/test_cpu_gpu_determinism.go @@ -4,6 +4,7 @@ import ( "fmt" cpurank "github.com/cybercongress/cyberd/cosmos/poc/app/rank" . "github.com/cybercongress/cyberd/cosmos/poc/app/storage" + "github.com/tendermint/tendermint/libs/log" ) /* @@ -78,14 +79,14 @@ func main() { m.AddLink(LinkedCids{FromCid: CidNumber(4), ToCid: CidNumber(3), Creator: AccountNumber(2)}) m.AddLink(LinkedCids{FromCid: CidNumber(5), ToCid: CidNumber(4), Creator: AccountNumber(1)}) - rank, _ = cpurank.CalculateRank(&m, cpurank.CPU) + rank, _ = cpurank.CalculateRank(&m, cpurank.CPU, log.NewNopLogger()) fmt.Printf("Rank calculated on cpu...\n") for c, r := range rank { fmt.Printf("%v -> %v\n", c, r) } - rank, _ = cpurank.CalculateRank(&m, cpurank.GPU) + rank, _ = cpurank.CalculateRank(&m, cpurank.GPU, log.NewNopLogger()) fmt.Printf("Rank calculated on gpu via cyberd ...\n") for c, r := range rank {