{ lib , stdenv , fetchFromGitHub , rocmUpdateScript , cmake , rocm-cmake , rocm-device-libs , clr , pkg-config , rpp , rocblas , miopengemm , miopen , migraphx , clang , openmp , protobuf , qtcreator , opencv , ffmpeg , boost , libjpeg_turbo , half , lmdb , rapidjson , rocm-docs-core , python3Packages , useOpenCL ? false , useCPU ? false , buildDocs ? false # Needs internet , gpuTargets ? [ ] }: stdenv.mkDerivation (finalAttrs: { pname = "mivisionx-" + ( if (!useOpenCL && !useCPU) then "hip" else if (!useOpenCL && !useCPU) then "opencl" else "cpu" ); version = "5.7.1"; src = fetchFromGitHub { owner = "ROCm"; repo = "MIVisionX"; rev = "rocm-${finalAttrs.version}"; hash = "sha256-jmOgwESNALQt7ctmUY9JHgKq47tCwsW1ybynkX9236U="; }; patches = [ ../../6/mivisionx/0001-set-__STDC_CONSTANT_MACROS-to-make-rocAL-compile.patch ]; nativeBuildInputs = [ cmake rocm-cmake clr pkg-config ] ++ lib.optionals buildDocs [ rocm-docs-core python3Packages.python ]; buildInputs = [ miopengemm miopen migraphx rpp rocblas openmp half protobuf qtcreator opencv ffmpeg boost libjpeg_turbo lmdb rapidjson python3Packages.pybind11 python3Packages.numpy python3Packages.torchWithRocm ]; cmakeFlags = [ "-DROCM_PATH=${clr}" "-DAMDRPP_PATH=${rpp}" # Manually define CMAKE_INSTALL_