New port: graphics/oidn: Intel(R) Open Image Denoise library

This commit is contained in:
Yuri Victorovich 2019-02-18 07:12:38 +00:00
parent 9427b654e7
commit 25b9210a56
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=493246
8 changed files with 154 additions and 0 deletions

View File

@ -591,6 +591,7 @@
SUBDIR += ocrad
SUBDIR += ocre
SUBDIR += ogre3d
SUBDIR += oidn
SUBDIR += okular
SUBDIR += open3d
SUBDIR += opencollada

27
graphics/oidn/Makefile Normal file
View File

@ -0,0 +1,27 @@
# $FreeBSD$
PORTNAME= oidn
DISTVERSIONPREFIX= v
DISTVERSION= 0.8.1
CATEGORIES= graphics
MAINTAINER= yuri@FreeBSD.org
COMMENT= Intel(R) Open Image Denoise library
LICENSE= APACHE20
LICENSE_FILE= ${WRKSRC}/LICENSE.txt
LIB_DEPENDS= libtbb.so:devel/tbb
USES= cmake compiler:c++11-lang
USE_GITHUB= yes
GH_ACCOUNT= OpenImageDenoise
GH_TUPLE= OpenImageDenoise:oidn-weights:cd8e2ce:w/weights \
OpenImageDenoise:mkl-dnn:9507eb9:m/mkl-dnn
USE_LDCONFIG= yes
OPTIONS_DEFINE= DOCS
DOCSDIR= share/doc/${GH_ACCOUNT}
.include <bsd.port.mk>

7
graphics/oidn/distinfo Normal file
View File

@ -0,0 +1,7 @@
TIMESTAMP = 1550471654
SHA256 (OpenImageDenoise-oidn-v0.8.1_GH0.tar.gz) = f9ab0feb83cf5494448db0c147f35bfc4a834fdfb2e4d4910c6b6685fec14b27
SIZE (OpenImageDenoise-oidn-v0.8.1_GH0.tar.gz) = 159658
SHA256 (OpenImageDenoise-oidn-weights-cd8e2ce_GH0.tar.gz) = 7f242a227f641d3e2cc968b25db4825efc15feb11e4bb58ee2ee888c65f758fc
SIZE (OpenImageDenoise-oidn-weights-cd8e2ce_GH0.tar.gz) = 31599866
SHA256 (OpenImageDenoise-mkl-dnn-9507eb9_GH0.tar.gz) = 0e00ce128f4cb42ada6feebd71d768e04abab6ad9d80422645be657ac7140f0a
SIZE (OpenImageDenoise-mkl-dnn-9507eb9_GH0.tar.gz) = 1413499

View File

@ -0,0 +1,11 @@
--- cmake/install.cmake.orig 2019-02-18 06:48:48 UTC
+++ cmake/install.cmake
@@ -45,7 +45,7 @@ install(DIRECTORY include/OpenImageDenoi
## Install documentation
## ----------------------------------------------------------------------------
-install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
+#install(FILES ${PROJECT_SOURCE_DIR}/LICENSE.txt DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
install(FILES ${PROJECT_SOURCE_DIR}/CHANGELOG.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
install(FILES ${PROJECT_SOURCE_DIR}/README.md DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)
install(FILES ${PROJECT_SOURCE_DIR}/readme.pdf DESTINATION ${CMAKE_INSTALL_DOCDIR} COMPONENT lib)

View File

@ -0,0 +1,56 @@
--- common/thread.cpp.orig 2019-02-18 06:42:30 UTC
+++ common/thread.cpp
@@ -14,6 +14,8 @@
// limitations under the License. //
// ======================================================================== //
+#include <pthread_np.h>
+
#if defined(_MSC_VER)
#pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned
#endif
@@ -132,7 +135,7 @@ namespace oidn {
OIDN_WARNING("SetThreadGroupAffinity failed");
}
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__FreeBSD__)
// --------------------------------------------------------------------------
// ThreadAffinity - Linux
@@ -176,7 +179,7 @@ namespace oidn {
for (size_t i = 0; i < threadIds.size(); ++i)
{
- cpu_set_t affinity;
+ cpuset_t affinity;
CPU_ZERO(&affinity);
CPU_SET(threadIds[i], &affinity);
@@ -193,7 +196,7 @@ namespace oidn {
const pthread_t thread = pthread_self();
// Save the current affinity
- if (pthread_getaffinity_np(thread, sizeof(cpu_set_t), &oldAffinities[threadIndex]) != 0)
+ if (pthread_getaffinity_np(thread, sizeof(cpuset_t), &oldAffinities[threadIndex]) != 0)
{
OIDN_WARNING("pthread_getaffinity_np failed");
oldAffinities[threadIndex] = affinities[threadIndex];
@@ -201,7 +204,7 @@ namespace oidn {
}
// Set the new affinity
- if (pthread_setaffinity_np(thread, sizeof(cpu_set_t), &affinities[threadIndex]) != 0)
+ if (pthread_setaffinity_np(thread, sizeof(cpuset_t), &affinities[threadIndex]) != 0)
OIDN_WARNING("pthread_setaffinity_np failed");
}
@@ -213,7 +216,7 @@ namespace oidn {
const pthread_t thread = pthread_self();
// Restore the original affinity
- if (pthread_setaffinity_np(thread, sizeof(cpu_set_t), &oldAffinities[threadIndex]) != 0)
+ if (pthread_setaffinity_np(thread, sizeof(cpuset_t), &oldAffinities[threadIndex]) != 0)
OIDN_WARNING("pthread_setaffinity_np failed");
}

View File

@ -0,0 +1,24 @@
--- common/thread.h.orig 2019-02-18 06:37:35 UTC
+++ common/thread.h
@@ -142,7 +142,9 @@ namespace oidn {
void restore(int threadIndex);
};
-#elif defined(__linux__)
+#elif defined(__linux__) || defined(__FreeBSD__)
+
+#include <sys/cpuset.h>
// --------------------------------------------------------------------------
// ThreadAffinity - Linux
@@ -151,8 +153,8 @@ namespace oidn {
class ThreadAffinity
{
private:
- std::vector<cpu_set_t> affinities; // thread affinities
- std::vector<cpu_set_t> oldAffinities; // original thread affinities
+ std::vector<cpuset_t> affinities; // thread affinities
+ std::vector<cpuset_t> oldAffinities; // original thread affinities
public:
ThreadAffinity(int numThreadsPerCore = INT_MAX);

15
graphics/oidn/pkg-descr Normal file
View File

@ -0,0 +1,15 @@
Intel Open Image Denoise is an open source library of high-performance,
high-quality denoising filters for images rendered with ray tracing. Open Image
Denoise is part of the Intel Rendering Framework and is released under the
permissive Apache 2.0 license.
The purpose of Open Image Denoise is to provide an open, high-quality,
efficient, and easy-to-use denoising library that allows one to significantly
reduce rendering times in ray tracing based rendering applications. It filters
out the Monte Carlo noise inherent to stochastic ray tracing methods like path
tracing, reducing the amount of necessary samples per pixel by even multiple
orders of magnitude (depending on the desired closeness to the ground truth).
A simple but flexible C/C++ API ensures that the library can be easily
integrated into most existing or new rendering solutions.
WWW: https://openimagedenoise.github.io/

13
graphics/oidn/pkg-plist Normal file
View File

@ -0,0 +1,13 @@
bin/denoise
include/OpenImageDenoise/oidn.h
include/OpenImageDenoise/oidn.hpp
include/OpenImageDenoise/version.h
lib/cmake/OpenImageDenoise/OpenImageDenoiseConfig-%%CMAKE_BUILD_TYPE%%.cmake
lib/cmake/OpenImageDenoise/OpenImageDenoiseConfig.cmake
lib/cmake/OpenImageDenoise/OpenImageDenoiseConfigVersion.cmake
lib/libOpenImageDenoise.so
lib/libOpenImageDenoise.so.0
lib/libOpenImageDenoise.so.0.8.1
%%PORTDOCS%%%%DOCSDIR%%/CHANGELOG.md
%%PORTDOCS%%%%DOCSDIR%%/README.md
%%PORTDOCS%%%%DOCSDIR%%/readme.pdf