Commit 903d9482 authored by Valentin Reis's avatar Valentin Reis

Adds candle package

parent c9df6e93
Pipeline #7655 passed with stages
in 22 minutes and 25 seconds
{ lib
, src
, stdenv
, libnrm
, nrmSupport ? false
, pythonPackages
, hdf5
}:
let
inherit (stdenv.lib) optional;
in
stdenv.mkDerivation rec {
name = "candle";
inherit src;
buildInputs = [
pythonPackages.tensorflow
hdf5
pythonPackages.Theano
pythonPackages.Keras
pythonPackages.requests
pythonPackages.pandas
pythonPackages.scikitlearn
pythonPackages.matplotlib
pythonPackages.tqdm
pythonPackages.numpy
pythonPackages.opencv
] ++ (optional nrmSupport libnrm);
}
{
"fetch": {
"args": {
"fetchSubmodules": false,
"rev": "bdcd7aff38b58156eba5713df96d3abe1f333bf3",
"sha256": "1ngdkcw3x4g90all6hp2yg53qm4nidjl8zm8l5ibf54wi53gr6q6",
"url": "https://xgitlab.cels.anl.gov/argo/applications/candle/Benchmarks.git"
},
"fn": "fetchgit"
},
"rev": "refs/heads/progress-nrm",
"type": "fetchgit",
"url": "https://xgitlab.cels.anl.gov/argo/applications/candle/Benchmarks.git"
}
\ No newline at end of file
{ stdenv
, fetchFromGitHub
, cmake
, gfortran
, blas
, boost
, python
, ocl-icd
, opencl-headers
, Accelerate, CoreGraphics, CoreVideo, OpenCL
}:
stdenv.mkDerivation rec {
name = "clblas-${version}";
version = "2.12";
src = fetchFromGitHub {
owner = "clMathLibraries";
repo = "clBLAS";
rev = "v${version}";
sha256 = "154mz52r5hm0jrp5fqrirzzbki14c1jkacj75flplnykbl36ibjs";
};
patches = [ ./platform.patch ];
postPatch = ''
sed -i -re 's/(set\(\s*Boost_USE_STATIC_LIBS\s+).*/\1OFF\ \)/g' src/CMakeLists.txt
'';
preConfigure = ''
cd src
'';
cmakeFlags = [
"-DBUILD_TEST=OFF"
];
buildInputs = [
cmake
gfortran
blas
python
boost
] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
ocl-icd
opencl-headers
] ++ stdenv.lib.optionals stdenv.isDarwin [
Accelerate
CoreGraphics
CoreVideo
];
propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [
OpenCL
];
enableParallelBuilding = true;
meta = with stdenv.lib; {
homepage = "https://github.com/clMathLibraries/clBLAS";
description = "A software library containing BLAS functions written in OpenCL";
longDescription = ''
This package contains a library of BLAS functions on top of OpenCL.
'';
license = licenses.asl20;
maintainers = with maintainers; [ artuuge ];
platforms = platforms.unix;
};
}
diff --git a/src/library/tools/ktest/config.cpp b/src/library/tools/ktest/config.cpp
index 8b20128..faf9bde 100644
--- a/src/library/tools/ktest/config.cpp
+++ b/src/library/tools/ktest/config.cpp
@@ -24,8 +24,6 @@
using namespace clMath;
-static const char DEFAULT_PLATFORM_NAME[] = "AMD Accelerated Parallel Processing";
-
Config::Config() :
defaultConfig_(""),
cpp_("ktest.cpp"),
@@ -35,7 +33,10 @@ Config::Config() :
hasFuncID_(false), hasSubdims_(false),
skipAccuracy_(false)
{
- setPlatform(DEFAULT_PLATFORM_NAME);
+ platform_ = NULL;
+ setPlatform("");
+
+ device_ = NULL;
setDevice("");
memset(&kargs_, 0, sizeof(kargs_));
@@ -262,7 +263,7 @@ Config::setPlatform(const std::string& name)
continue;
}
if (name.empty()) {
- found = (strcmp(pname, DEFAULT_PLATFORM_NAME) == 0);
+ found = true;
}
else {
found = (strcmp(pname, name.c_str()) == 0);
......@@ -23,6 +23,7 @@
, openmc-src ? fetched openmc/pin.json
, stream-src ? fetched stream/pin.json
, lammps-src ? fetched lammps/pin.json
, candle-src ? fetched candle/pin.json
#source overrides: tooling
, repoquality-src ? builtins.fetchGit {inherit (fetched repoquality/pin.json) url rev;}
......@@ -169,6 +170,16 @@ let
lammps = repLibnrm ./lammps lammps-src {};
stream = repLibnrm ./stream stream-src {iterationCount="2000";};
callCandlePackage = candlePkgs.lib.callPackageWith (candlePkgs);
candleOverlay = self: super: rec { clblas = callCandlePackage ./clblas {
inherit (pkgs.darwin.apple_sdk.frameworks) Accelerate CoreGraphics CoreVideo OpenCL;
};
};
candlePkgs = import pkgs.path {
overlays = [ candleOverlay ] ;
};
candle = callCandlePackage ./candle {src = candle-src; libnrm= libnrm;};
# data (static, non source overridable via arguments)
openmc-data = fetched openmc/data.json;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment