-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix for using PkgBenchmarks instead (#94)
* fix for using PkgBenchmarks instead * srand to fix Float32 failure
- Loading branch information
1 parent
6391974
commit f99f9e1
Showing
6 changed files
with
44 additions
and
144 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
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,39 @@ | ||
using Tensors | ||
using BenchmarkTools | ||
using ForwardDiff | ||
|
||
const SUITE = BenchmarkGroup() | ||
const ALL_DIMENSIONS = true | ||
const MIXED_SYM_NONSYM = true | ||
const MIXED_ELTYPES = true | ||
|
||
const dT = ForwardDiff.Dual{Nothing,Float64,4} | ||
|
||
function create_tensors() | ||
tensor_dict = Dict{Tuple{Int, Int, DataType}, AbstractTensor}() | ||
symtensor_dict = Dict{Tuple{Int, Int, DataType}, AbstractTensor}() | ||
for dim in 1:3 | ||
for order in (1,2,4) | ||
for T in (Float32, Float64) | ||
tensor_dict[(dim, order, T)] = rand(Tensor{order, dim, T}) | ||
if order != 1 | ||
symtensor_dict[(dim, order, T)] = rand(SymmetricTensor{order, dim, T}) | ||
else | ||
symtensor_dict[(dim, order, T)] = rand(Tensor{order, dim, T}) | ||
end | ||
end | ||
tensor_dict[(dim, order, dT)] = Tensor{order, dim, dT}(([ForwardDiff.Dual(rand(5)...,) for i in 1:length(rand(Tensor{order, dim}))]...,)) | ||
if order != 1 | ||
symtensor_dict[(dim, order, dT)] = SymmetricTensor{order, dim, dT}(([ForwardDiff.Dual(rand(5)...,) for i in 1:length(rand(SymmetricTensor{order, dim}).data)]...,)) | ||
else | ||
symtensor_dict[(dim, order, dT)] = Tensor{order, dim, dT}(([ForwardDiff.Dual(rand(5)...,) for i in 1:length(rand(Tensor{order, dim}).data)]...,)) | ||
end | ||
end | ||
end | ||
return tensor_dict, symtensor_dict | ||
end | ||
|
||
tensor_dict, symtensor_dict = create_tensors() | ||
|
||
include("benchmark_functions.jl") | ||
include("benchmark_ad.jl") |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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