/* * Advanced Simulation Library * * Copyright 2015 Avtech Scientific * * * This file is part of Advanced Simulation Library (ASL). * * ASL is free software: you can redistribute it and/or modify it * under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, version 3 of the License. * * ASL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with ASL. If not, see . * */ /** \example testPrivateVar.cc */ #include "utilities/aslUValue.h" #include "acl/Kernels/aclKernel.h" #include "acl/Kernels/aclKernelConfigurationTemplates.h" #include #include #include #include const unsigned int nLength(1000000); const unsigned int nOperations(10); const unsigned int nCycles(10000); const acl::KernelConfiguration & kConf(acl::KERNEL_BASIC); //const acl::KernelConfiguration & kConf(acl::KERNEL_SIMDUA); bool testKernelUnoptimized() { cout << "Test of \"Simple kernel\" function..." << flush; auto vec1(acl::generateVEData(nLength,1u)); acl::Kernel k(kConf); auto res(acl::generateVEPrivateVariable(1u, acl::TYPE_FLOAT)); k << (res = acl::generateVEConstant(0.)); for(unsigned int i(0); i(nLength,1u)); acl::Kernel k(kConf); auto res(acl::generateVEPrivateVariable(1u, acl::TYPE_FLOAT)); k << (res = acl::generateVEConstant(0.)); vector tempRes(nOperations); for(unsigned int i(0); i(nLength,1u)); acl::Kernel k(kConf); auto res(acl::generateVEPrivateVariable(1u, acl::TYPE_FLOAT)); auto tempRes(acl::generateVEPrivateVariable(1u, acl::TYPE_FLOAT)); k << (res = acl::generateVEConstant(0.)); for(unsigned int i(0); i