Index: head/graphics/waifu2x-converter-cpp/files/patch-no-sse3 =================================================================== --- head/graphics/waifu2x-converter-cpp/files/patch-no-sse3 (revision 398557) +++ head/graphics/waifu2x-converter-cpp/files/patch-no-sse3 (nonexistent) @@ -1,70 +0,0 @@ -https://github.com/tanakamura/waifu2x-converter-cpp/pull/5 - -diff --git src/Env.cpp src/Env.cpp -index 76c1859..9ad0a3c 100644 ---- src/Env.cpp -+++ src/Env.cpp -@@ -28,6 +28,10 @@ ComputeEnv::ComputeEnv() - #endif - this->flags = 0; - -+ if (ecx & (1<<0)) { -+ this->flags |= ComputeEnv::HAVE_CPU_SSE3; -+ } -+ - if ((ecx & 0x18000000) == 0x18000000) { - this->flags |= ComputeEnv::HAVE_CPU_AVX; - } -diff --git src/Env.hpp src/Env.hpp -index 8087431..0c2e22a 100644 ---- src/Env.hpp -+++ src/Env.hpp -@@ -19,6 +19,7 @@ struct ComputeEnv { - - static const int HAVE_CPU_FMA = 1<<0; - static const int HAVE_CPU_AVX = 1<<1; -+ static const int HAVE_CPU_SSE3 = 1<<2; - - int flags; - -diff --git src/modelHandler.cpp src/modelHandler.cpp -index 2f72442..1e74ba0 100644 ---- src/modelHandler.cpp -+++ src/modelHandler.cpp -@@ -100,6 +100,7 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - - bool have_fma = env->flags & ComputeEnv::HAVE_CPU_FMA; - bool have_avx = env->flags & ComputeEnv::HAVE_CPU_AVX; -+ bool have_sse3 = env->flags & ComputeEnv::HAVE_CPU_SSE3; - - bool gpu = (rt == RUN_OPENCL) || (rt == RUN_CUDA); - -@@ -317,10 +318,12 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - filter_AVX_impl(env, packed_input, packed_output, - nInputPlanes, nOutputPlanes, fbiases_flat, weight_flat, - size.width, size.height, nJob); -- } else { -+ } else if (have_sse3) { - filter_SSE_impl(env, packed_input, packed_output, - nInputPlanes, nOutputPlanes, fbiases_flat, weight_flat, - size.width, size.height, nJob); -+ } else { -+ filter_CV(env, packed_input_buf, packed_output_buf, size); - } - } - -@@ -379,11 +382,12 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - const float *packed_input = (float*)packed_input_buf->get_read_ptr_host(env, in_size); - float *packed_output = (float*)packed_output_buf->get_write_ptr_host(env); - -- if (!have_avx) { -+ if (!have_sse3) { -+ filter_CV(env, packed_input_buf, packed_output_buf, size); -+ } else if (!have_avx) { - filter_SSE_impl(env, packed_input, packed_output, - nInputPlanes, nOutputPlanes, fbiases_flat, weight_flat, - size.width, size.height, nJob); -- //filter_CV(env, packed_input_buf, packed_output_buf, size); - } else { - if (have_fma) { - filter_FMA_impl(env, packed_input, packed_output, Property changes on: head/graphics/waifu2x-converter-cpp/files/patch-no-sse3 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/waifu2x-converter-cpp/files/patch-non-x86 =================================================================== --- head/graphics/waifu2x-converter-cpp/files/patch-non-x86 (revision 398557) +++ head/graphics/waifu2x-converter-cpp/files/patch-non-x86 (nonexistent) @@ -1,168 +0,0 @@ -https://github.com/tanakamura/waifu2x-converter-cpp/pull/6 - -diff --git CMakeLists.txt CMakeLists.txt -index bcb0338..899ee7b 100644 ---- CMakeLists.txt -+++ CMakeLists.txt -@@ -58,10 +58,24 @@ endif() - find_library(IMGCODECS_LIBRARY NAMES opencv_imgcodecs opencv_highgui - HINTS ${OPENCV_PREFIX}/lib) - -+if(CMAKE_SYSTEM_PROCESSOR STREQUAL "amd64" OR -+ CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR -+ CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") -+ set(X86_TRUE true) -+else() -+ set(X86_TRUE false) -+endif() -+ -+option(X86OPT "Enable X86 SIMD optimizations" ${X86_TRUE}) -+if(X86OPT) -+ add_definitions(-DX86OPT) -+ set(X86OPT_SOURCES src/modelHandler_avx.cpp src/modelHandler_fma.cpp src/modelHandler_sse.cpp) -+endif() -+ - add_executable(waifu2x-converter-cpp - src/main.cpp) - add_library(w2xc SHARED -- src/modelHandler.cpp src/modelHandler_avx.cpp src/modelHandler_fma.cpp src/modelHandler_sse.cpp -+ src/modelHandler.cpp ${X86OPT_SOURCES} - src/modelHandler_OpenCL.cpp src/convertRoutine.cpp src/threadPool.cpp - src/modelHandler_CUDA.cpp src/w2xconv.cpp src/common.cpp - src/Env.cpp -diff --git src/Env.cpp src/Env.cpp -index 76c1859..2c1069d 100644 ---- src/Env.cpp -+++ src/Env.cpp -@@ -1,11 +1,13 @@ - #include "Env.hpp" - #include "Buffer.hpp" - -+#ifdef X86OPT - #ifdef __GNUC__ - #include - #else - #include - #endif -+#endif // X86OPT - - ComputeEnv::ComputeEnv() - :num_cl_dev(0), -@@ -14,6 +16,9 @@ ComputeEnv::ComputeEnv() - cuda_dev_list(nullptr), - transfer_wait(0) - { -+ this->flags = 0; -+ -+#ifdef X86OPT - unsigned int eax=0, ebx=0, ecx=0, edx=0; - - #ifdef __GNUC__ -@@ -26,8 +31,6 @@ ComputeEnv::ComputeEnv() - ecx = cpuInfo[2]; - edx = cpuInfo[3]; - #endif -- this->flags = 0; -- - if (ecx & (1<<0)) { - this->flags |= ComputeEnv::HAVE_CPU_SSE3; - } -@@ -35,6 +38,7 @@ ComputeEnv::ComputeEnv() - if (ecx & (1<<12)) { - this->flags |= ComputeEnv::HAVE_CPU_FMA; - } -+#endif // X86OPT - - this->pref_block_size = 512; - } -diff --git src/modelHandler.cpp src/modelHandler.cpp -index 2f72442..1a3d87e 100644 ---- src/modelHandler.cpp -+++ src/modelHandler.cpp -@@ -306,6 +306,7 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - nInputPlanes, nOutputPlanes, fbiases_flat, weight_flat, - size.width, size.height, nJob); - } else { -+#ifdef X86OPT - const float *packed_input = (float*)packed_input_buf->get_read_ptr_host(env, in_size); - float *packed_output = (float*)packed_output_buf->get_write_ptr_host(env); - -@@ -322,6 +323,9 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - nInputPlanes, nOutputPlanes, fbiases_flat, weight_flat, - size.width, size.height, nJob); - } -+#else -+ filter_CV(env, packed_input_buf, packed_output_buf, size); -+#endif - } - - double t2 = getsec(); -@@ -376,6 +380,7 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - nInputPlanes, nOutputPlanes, fbiases_flat, weight_flat, - size.width, size.height, nJob); - } else { -+#ifdef X86OPT - const float *packed_input = (float*)packed_input_buf->get_read_ptr_host(env, in_size); - float *packed_output = (float*)packed_output_buf->get_write_ptr_host(env); - -@@ -395,6 +400,9 @@ bool Model::filter_AVX_OpenCL(ComputeEnv *env, - size.width, size.height, nJob); - } - } -+#else -+ filter_CV(env, packed_input_buf, packed_output_buf, size); -+#endif - } - } - -diff --git src/modelHandler_OpenCL.cpp src/modelHandler_OpenCL.cpp -index ea4fd9b..13da2a2 100644 ---- src/modelHandler_OpenCL.cpp -+++ src/modelHandler_OpenCL.cpp -@@ -16,13 +16,6 @@ - #include "CLlib.h" - #include "params.h" - --#ifdef __GNUC__ --#include --#else --#include --#endif -- -- - static const char prog[] = - #include "modelHandler_OpenCL.cl.h" - ; -diff --git src/w2xconv.cpp src/w2xconv.cpp -index 5ed00bd..94b08c4 100644 ---- src/w2xconv.cpp -+++ src/w2xconv.cpp -@@ -1,10 +1,12 @@ - #define W2XCONV_IMPL - - #include -+#ifdef X86OPT - //#if (defined __GNUC__) || (defined __clang__) - #ifndef _WIN32 - #include - #endif -+#endif // X86OPT - #include "w2xconv.h" - #include "sec.hpp" - #include "Buffer.hpp" -@@ -63,6 +65,7 @@ w2xconv_init(enum W2XConvGPUMode gpu, - c->target_processor.devid = 0; - impl->dev_name = impl->env.cl_dev_list[0].name.c_str(); - } else { -+#ifdef X86OPT - { - - #ifdef _WIN32 -@@ -91,6 +94,7 @@ w2xconv_init(enum W2XConvGPUMode gpu, - - c->target_processor.type = W2XCONV_PROC_HOST; - } -+#endif // X86OPT - } - - c->target_processor.dev_name = impl->dev_name.c_str(); Property changes on: head/graphics/waifu2x-converter-cpp/files/patch-non-x86 ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/waifu2x-converter-cpp/files/patch-freebsd =================================================================== --- head/graphics/waifu2x-converter-cpp/files/patch-freebsd (revision 398557) +++ head/graphics/waifu2x-converter-cpp/files/patch-freebsd (nonexistent) @@ -1,92 +0,0 @@ -https://github.com/tanakamura/waifu2x-converter-cpp/pull/3 - -diff --git src/Buffer.hpp src/Buffer.hpp -index 2152cf3..e69d10b 100644 ---- src/Buffer.hpp -+++ src/Buffer.hpp -@@ -1,8 +1,10 @@ - #ifndef BUFFER_HPP - #define BUFFER_HPP - --#ifndef __APPLE__ -+#if defined(_MSC_VER) - #include -+#elif defined(__GNUC__) -+#include - #endif - - #include -diff --git src/Env.hpp src/Env.hpp -index 8087431..7003c80 100644 ---- src/Env.hpp -+++ src/Env.hpp -@@ -26,7 +26,7 @@ struct ComputeEnv { - - struct W2XConvProcessor target_processor; - --#ifndef __APPLE__ -+#if defined(_WIN32) || defined(__linux) - w2xc::ThreadPool *tpool; - #endif - ComputeEnv(); -diff --git src/modelHandler_avx_func.hpp src/modelHandler_avx_func.hpp -index 2459792..27514e5 100644 ---- src/modelHandler_avx_func.hpp -+++ src/modelHandler_avx_func.hpp -@@ -699,7 +699,7 @@ filter_AVX_impl0(ComputeEnv *env, - } - }; - --#ifdef __APPLE__ -+#if !defined(_WIN32) && !defined(__linux) - std::vector workerThreads; - for (int ji=0; ji - #include "threadPool.hpp" - --#ifndef __APPLE__ -+#if defined(_WIN32) || defined(__linux) - - namespace w2xc { - -diff --git src/threadPool.hpp src/threadPool.hpp -index 2a905ea..34f6586 100644 ---- src/threadPool.hpp -+++ src/threadPool.hpp -@@ -1,7 +1,7 @@ - #ifndef THREAD_POOL_HPP - #define THREAD_POOL_HPP - --#ifndef __APPLE__ -+#if defined(_WIN32) || defined(__linux) - - #include - #include -diff --git src/w2xconv.cpp src/w2xconv.cpp -index 5ed00bd..de78ad8 100644 ---- src/w2xconv.cpp -+++ src/w2xconv.cpp -@@ -36,7 +36,7 @@ w2xconv_init(enum W2XConvGPUMode gpu, - nJob = std::thread::hardware_concurrency(); - } - --#ifndef __APPLE__ -+#if defined(_WIN32) || defined(__linux) - impl->env.tpool = w2xc::initThreadPool(nJob); - #endif - -@@ -248,7 +248,7 @@ w2xconv_fini(struct W2XConv *conv) - - w2xc::finiCUDA(&impl->env); - w2xc::finiOpenCL(&impl->env); --#ifndef __APPLE__ -+#if defined(_WIN32) || defined(__linux) - w2xc::finiThreadPool(impl->env.tpool); - #endif - Property changes on: head/graphics/waifu2x-converter-cpp/files/patch-freebsd ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/waifu2x-converter-cpp/Makefile =================================================================== --- head/graphics/waifu2x-converter-cpp/Makefile (revision 398557) +++ head/graphics/waifu2x-converter-cpp/Makefile (revision 398558) @@ -1,84 +1,70 @@ # $FreeBSD$ PORTNAME= waifu2x-converter-cpp -DISTVERSION= 1.0.0-237 -DISTVERSIONSUFFIX= -gca65c93 -PORTREVISION= 3 +DISTVERSION= 1.0.0-249 +DISTVERSIONSUFFIX= -g6f0fdc6 CATEGORIES= graphics MASTER_SITES= https://aur.archlinux.org/cgit/aur.git/plain/:manpage DISTFILES= ${DISTNAME}${EXTRACT_SUFX} \ ${PORTNAME:C/-.*//}.1.gz?h=${PORTNAME:C/-.*//}-git\&id=5c150a5:manpage EXTRACT_ONLY= ${DISTFILES:N*\:manpage:C/:.*//} MAINTAINER= jbeich@FreeBSD.org COMMENT= Scale and denoise images using convolutional neural networks LICENSE= BSD2CLAUSE MIT LICENSE_COMB= multi LICENSE_FILE_BSD2CLAUSE=${WRKSRC}/LICENSE LICENSE_FILE_MIT= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${LOCALBASE}/include/CL/opencl.h:${PORTSDIR}/devel/opencl LIB_DEPENDS= libopencv_highgui.so:${PORTSDIR}/graphics/opencv \ libopencv_imgproc.so:${PORTSDIR}/graphics/opencv-core USE_GITHUB= yes GH_ACCOUNT= tanakamura USES= cmake compiler:c++11-lib dos2unix DOS2UNIX_GLOB= *.cpp *.hpp CMAKE_ARGS= -DOPENCV_PREFIX="${LOCALBASE}" \ -DOpenCL_LIBRARY="${LOCALBASE}/lib/libOpenCL.so" \ - -DCMAKE_SKIP_RPATH=on # XXX use cmake install() instead + -DINSTALL_MODELS=on CFLAGS+= -D_GLIBCXX_USE_C99 -D_GLIBCXX_USE_C99_MATH_TR1 \ -D_DECLARE_C99_LDBL_MATH # XXX ports/193528 LDFLAGS+= -Wl,--as-needed # avoid overlinking (opencv deps) +TEST_TARGET= test ARGS="-V" USE_LDCONFIG= yes PLIST_FILES= bin/${PORTNAME} \ man/man1/${PORTNAME}.1.gz \ include/w2xconv.h \ lib/libw2xc.so -PORTDATA= models_rgb +PORTDATA= * PORTDOCS= * OPTIONS_DEFINE= DOCS SIMD OPTIONS_DEFAULT=SIMD +DOCS_CMAKE_ON= -DINSTALL_DOCS=on SIMD_CMAKE_OFF= -DX86OPT=off post-extract: @${GZCAT} ${_DISTDIR}/${DISTFILES:M*\:manpage:C/:.*//} \ >${WRKDIR}/${PORTNAME}.1 post-patch: @${REINPLACE_CMD} -e 's,-O2,,; /SYMBOL/s,-s,,' \ ${WRKSRC}/CMakeLists.txt - @${REINPLACE_CMD} -e '/"models/s,","${DATADIR}/,' \ + @${REINPLACE_CMD} \ -e '/CmdLine/s,[^"]*"),${DISTVERSIONFULL}"),' \ ${WRKSRC}/src/main.cpp # Undo AUR rename and use version from |git describe --tags| @${REINPLACE_CMD} -e '/AUTHORS/,$$! { /\.B mai/! \ s,${PORTNAME:C/-.*//},${PORTNAME},; }' \ -e '1s,\(version\) [^"]*,\1 ${DISTVERSIONFULL},' \ ${WRKDIR}/${PORTNAME}.1 -pre-install: -# XXX Fails on 9.x with error code 10 - -(cd ${WRKSRC} && LD_LIBRARY_PATH=. ./runtest) - -do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin +post-install: ${INSTALL_MAN} ${WRKDIR}/${PORTNAME}.1 \ ${STAGEDIR}${MAN1PREFIX}/man/man1 - ${INSTALL_LIB} ${WRKSRC}/libw2xc.so ${STAGEDIR}${PREFIX}/lib - ${INSTALL_DATA} -p ${WRKSRC}/src/w2xconv.h \ - ${STAGEDIR}${PREFIX}/include - (cd ${WRKSRC} && ${COPYTREE_SHARE} \ - "${PORTDATA}" ${STAGEDIR}${DATADIR}) - -post-install-DOCS-on: - (cd ${WRKSRC} && ${COPYTREE_SHARE} "appendix" ${STAGEDIR}${DOCSDIR}) - (cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \ - "internals" ${STAGEDIR}${DOCSDIR}) .include Index: head/graphics/waifu2x-converter-cpp/distinfo =================================================================== --- head/graphics/waifu2x-converter-cpp/distinfo (revision 398557) +++ head/graphics/waifu2x-converter-cpp/distinfo (revision 398558) @@ -1,4 +1,4 @@ -SHA256 (tanakamura-waifu2x-converter-cpp-1.0.0-237-gca65c93_GH0.tar.gz) = 5b34ecc43a9c9f976ab92c72b1ba6f45b8470ea05bb976738e732c3c01290c8e -SIZE (tanakamura-waifu2x-converter-cpp-1.0.0-237-gca65c93_GH0.tar.gz) = 14848013 +SHA256 (tanakamura-waifu2x-converter-cpp-1.0.0-249-g6f0fdc6_GH0.tar.gz) = 1eca7db107b20d27ccea49ffe075a80c9b4b8219245e1584920a0ef83fab7725 +SIZE (tanakamura-waifu2x-converter-cpp-1.0.0-249-g6f0fdc6_GH0.tar.gz) = 14848498 SHA256 (waifu2x.1.gz?h=waifu2x-git&id=5c150a5) = bfad3e87e43f20573ab068c386e150f93fb4cc37400b8f4aaf4734c9afbd1489 SIZE (waifu2x.1.gz?h=waifu2x-git&id=5c150a5) = 1242