/******************************************************************************* * Copyright (c) 2015-2018 Skymind, Inc. * * This program and the accompanying materials are made available under the * terms of the Apache License, Version 2.0 which is available at * https://www.apache.org/licenses/LICENSE-2.0. * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * SPDX-License-Identifier: Apache-2.0 ******************************************************************************/ // // Created by raver119 on 20.11.17. // #include "testlayers.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace nd4j; using namespace nd4j::graph; class PlaygroundTests : public testing::Test { public: int numIterations = 3; int poolSize = 10; PlaygroundTests() { printf("\n"); fflush(stdout); } }; /* TEST_F(PlaygroundTests, test_relubp_1) { auto x = NDArrayFactory::create('c', {128, 64, 224, 224}); auto y = x.ulike(); auto z = x.ulike(); RandomGenerator rng(119, 120); RandomLauncher::fillUniform(LaunchContext::defaultContext(), rng, &x, -1.0, 1.0); RandomLauncher::fillUniform(LaunchContext::defaultContext(), rng, &y, -1.0, 1.0); int iterations = 10; auto timeStart = std::chrono::system_clock::now(); for (int e = 0; e < iterations; e++) ops::helpers::reluDerivative(LaunchContext::defaultContext(), &x, &y, &z); auto timeEnd = std::chrono::system_clock::now(); auto outerTime = std::chrono::duration_cast (timeEnd - timeStart).count(); auto time = (Nd4jLong) outerTime / iterations; auto bw = (1000000L * (float) (x.lengthOf() * x.sizeOfT()) / time) / 1024 / 1024 / 1024; nd4j_printf("Time: %lld; BW: %f GB/s\n", time, bw); } */