398 lines
14 KiB
Diff
398 lines
14 KiB
Diff
diff -Naur ispc-1.27.0-orig/examples/common/tasksys.cpp ispc-1.27.0/examples/common/tasksys.cpp
|
|
--- ispc-1.27.0-orig/examples/common/tasksys.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/common/tasksys.cpp 2025-06-10 15:33:13.880797200 +0300
|
|
@@ -55,9 +55,9 @@
|
|
defined ISPC_USE_TBB_PARALLEL_FOR || defined ISPC_USE_OMP || defined ISPC_USE_HPX)
|
|
|
|
// If no task model chosen from the compiler cmdline, pick a reasonable default
|
|
-#if defined(_WIN32) || defined(_WIN64)
|
|
+#if defined(_MSC_VER)
|
|
#define ISPC_USE_CONCRT
|
|
-#elif defined(__linux__) || defined(__FreeBSD__)
|
|
+#elif defined(__linux__) || defined(__FreeBSD__) || defined (__MINGW32__)
|
|
#define ISPC_USE_PTHREADS
|
|
#elif defined(__APPLE__)
|
|
#define ISPC_USE_GCD
|
|
@@ -136,6 +136,28 @@
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
|
|
+#ifdef __MINGW32__
|
|
+#include <windows.h>
|
|
+#define _SC_PAGESIZE 1
|
|
+#define _SC_NPROCESSORS_ONLN 2
|
|
+long sysconf(int tp) {
|
|
+ switch (tp) {
|
|
+ case _SC_PAGESIZE: {
|
|
+ SYSTEM_INFO inf;
|
|
+ GetSystemInfo(&inf);
|
|
+ return (long)inf.dwPageSize;
|
|
+ }
|
|
+ case _SC_NPROCESSORS_ONLN: {
|
|
+ SYSTEM_INFO inf;
|
|
+ GetSystemInfo(&inf);
|
|
+ return (long)inf.dwNumberOfProcessors;
|
|
+ }
|
|
+ default:
|
|
+ return -1L;
|
|
+ }
|
|
+}
|
|
+
|
|
+#endif
|
|
// Signature of ispc-generated 'task' functions
|
|
typedef void (*TaskFuncType)(void *data, int threadIndex, int threadCount, int taskIndex, int taskCount, int taskIndex0,
|
|
int taskIndex1, int taskIndex2, int taskCount0, int taskCount1, int taskCount2);
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/aobench/ao.cpp ispc-1.27.0/examples/cpu/aobench/ao.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/aobench/ao.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/aobench/ao.cpp 2025-06-10 15:38:39.581285800 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/aobench/ao_serial.cpp ispc-1.27.0/examples/cpu/aobench/ao_serial.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/aobench/ao_serial.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/aobench/ao_serial.cpp 2025-06-10 15:33:13.880797200 +0300
|
|
@@ -8,7 +8,7 @@
|
|
Based on Syoyo Fujita's aobench: http://code.google.com/p/aobench
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
@@ -18,7 +18,7 @@
|
|
#include <math.h>
|
|
#include <stdlib.h>
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
static long long drand48_x = 0x1234ABCD330E;
|
|
|
|
static inline void srand48(int x) { drand48_x = x ^ (x << 16); }
|
|
@@ -27,9 +27,9 @@
|
|
drand48_x = drand48_x * 0x5DEECE66D + 0xB;
|
|
return (drand48_x & 0xFFFFFFFFFFFF) * (1.0 / 281474976710656.0);
|
|
}
|
|
-#endif // _MSC_VER
|
|
+#endif // _WIN32
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
__declspec(align(16))
|
|
#endif
|
|
struct vec {
|
|
@@ -48,7 +48,7 @@
|
|
float x, y, z;
|
|
float pad;
|
|
}
|
|
-#ifndef _MSC_VER
|
|
+#ifndef _WIN32
|
|
__attribute__((aligned(16)))
|
|
#endif
|
|
;
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/aobench_instrumented/ao.cpp ispc-1.27.0/examples/cpu/aobench_instrumented/ao.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/aobench_instrumented/ao.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/aobench_instrumented/ao.cpp 2025-06-10 15:38:58.185972500 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
#pragma warning(disable : 4305)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/deferred/common.cpp ispc-1.27.0/examples/cpu/deferred/common.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/deferred/common.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/deferred/common.cpp 2025-06-10 15:33:13.880797200 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define ISPC_IS_WINDOWS
|
|
#elif defined(__linux__) || defined(__FreeBSD__)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/deferred/dynamic_c.cpp ispc-1.27.0/examples/cpu/deferred/dynamic_c.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/deferred/dynamic_c.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/deferred/dynamic_c.cpp 2025-06-10 15:33:13.880797200 +0300
|
|
@@ -11,7 +11,7 @@
|
|
#include <math.h>
|
|
#include <stdint.h>
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define ISPC_IS_WINDOWS
|
|
#elif defined(__linux__) || defined(__FreeBSD__)
|
|
#define ISPC_IS_LINUX
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/deferred/main.cpp ispc-1.27.0/examples/cpu/deferred/main.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/deferred/main.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/deferred/main.cpp 2025-06-10 15:33:13.896479000 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define ISPC_IS_WINDOWS
|
|
#define NOMINMAX
|
|
#elif defined(__linux__)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/gmres/matrix.cpp ispc-1.27.0/examples/cpu/gmres/matrix.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/gmres/matrix.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/gmres/matrix.cpp 2025-06-10 15:33:13.896479000 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#endif
|
|
/**************************************************************\
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/gmres/mmio.c ispc-1.27.0/examples/cpu/gmres/mmio.c
|
|
--- ispc-1.27.0-orig/examples/cpu/gmres/mmio.c 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/gmres/mmio.c 2025-06-10 15:33:13.896479000 +0300
|
|
@@ -6,7 +6,7 @@
|
|
*
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#endif
|
|
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/mandelbrot/mandelbrot.cpp ispc-1.27.0/examples/cpu/mandelbrot/mandelbrot.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/mandelbrot/mandelbrot.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/mandelbrot/mandelbrot.cpp 2025-06-10 15:33:13.896479000 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/mandelbrot_tasks/mandelbrot_tasks.cpp ispc-1.27.0/examples/cpu/mandelbrot_tasks/mandelbrot_tasks.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/mandelbrot_tasks/mandelbrot_tasks.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/mandelbrot_tasks/mandelbrot_tasks.cpp 2025-06-10 15:33:13.896479000 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/noise/noise.cpp ispc-1.27.0/examples/cpu/noise/noise.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/noise/noise.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/noise/noise.cpp 2025-06-10 15:33:13.896479000 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/options/options_serial.cpp ispc-1.27.0/examples/cpu/options/options_serial.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/options/options_serial.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/options/options_serial.cpp 2025-06-10 15:33:13.917883200 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/perfbench/perfbench.cpp ispc-1.27.0/examples/cpu/perfbench/perfbench.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/perfbench/perfbench.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/perfbench/perfbench.cpp 2025-06-10 15:33:13.921894800 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/rt/rt.cpp ispc-1.27.0/examples/cpu/rt/rt.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/rt/rt.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/rt/rt.cpp 2025-06-10 15:33:13.927292900 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/rt/rt_serial.cpp ispc-1.27.0/examples/cpu/rt/rt_serial.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/rt/rt_serial.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/rt/rt_serial.cpp 2025-06-10 15:33:13.932312200 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
@@ -15,7 +15,7 @@
|
|
#include <stdint.h>
|
|
|
|
// Just enough of a float3 class to do what we need in this file.
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
__declspec(align(16))
|
|
#endif
|
|
struct float3 {
|
|
@@ -33,7 +33,7 @@
|
|
float x, y, z;
|
|
float pad; // match padding/alignment of ispc version
|
|
}
|
|
-#ifndef _MSC_VER
|
|
+#ifndef _WIN32
|
|
__attribute__((aligned(16)))
|
|
#endif
|
|
;
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/sgemm/SGEMM_main.cpp ispc-1.27.0/examples/cpu/sgemm/SGEMM_main.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/sgemm/SGEMM_main.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/sgemm/SGEMM_main.cpp 2025-06-10 15:33:13.936324300 +0300
|
|
@@ -22,7 +22,7 @@
|
|
**/
|
|
// clang-format on
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#endif
|
|
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/stencil/stencil.cpp ispc-1.27.0/examples/cpu/stencil/stencil.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/stencil/stencil.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/stencil/stencil.cpp 2025-06-10 15:33:13.936324300 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/volume_rendering/volume.cpp ispc-1.27.0/examples/cpu/volume_rendering/volume.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/volume_rendering/volume.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/volume_rendering/volume.cpp 2025-06-10 15:39:45.787264900 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/cpu/volume_rendering/volume_serial.cpp ispc-1.27.0/examples/cpu/volume_rendering/volume_serial.cpp
|
|
--- ispc-1.27.0-orig/examples/cpu/volume_rendering/volume_serial.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/cpu/volume_rendering/volume_serial.cpp 2025-06-10 15:39:59.880861100 +0300
|
|
@@ -29,7 +29,7 @@
|
|
float x, y, z;
|
|
float pad; // match padding/alignment of ispc version
|
|
}
|
|
-#ifndef _MSC_VER
|
|
+#ifndef _WIN32
|
|
__attribute__((aligned(16)))
|
|
#endif
|
|
;
|
|
diff -Naur ispc-1.27.0-orig/examples/xpu/aobench/ao.cpp ispc-1.27.0/examples/xpu/aobench/ao.cpp
|
|
--- ispc-1.27.0-orig/examples/xpu/aobench/ao.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/xpu/aobench/ao.cpp 2025-06-10 15:33:13.946268800 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
#pragma warning(disable : 4305)
|
|
diff -Naur ispc-1.27.0-orig/examples/xpu/aobench/ao_serial.cpp ispc-1.27.0/examples/xpu/aobench/ao_serial.cpp
|
|
--- ispc-1.27.0-orig/examples/xpu/aobench/ao_serial.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/xpu/aobench/ao_serial.cpp 2025-06-10 15:33:13.948275600 +0300
|
|
@@ -8,7 +8,7 @@
|
|
Based on Syoyo Fujita's aobench: http://code.google.com/p/aobench
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
@@ -18,7 +18,7 @@
|
|
#include <math.h>
|
|
#include <stdlib.h>
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
static long long drand48_x = 0x1234ABCD330E;
|
|
|
|
static inline void srand48(int x) { drand48_x = x ^ (x << 16); }
|
|
@@ -27,9 +27,9 @@
|
|
drand48_x = drand48_x * 0x5DEECE66D + 0xB;
|
|
return (drand48_x & 0xFFFFFFFFFFFF) * (1.0 / 281474976710656.0);
|
|
}
|
|
-#endif // _MSC_VER
|
|
+#endif // _WIN32
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
__declspec(align(16))
|
|
#endif
|
|
struct vec {
|
|
@@ -48,7 +48,7 @@
|
|
float x, y, z;
|
|
float pad;
|
|
}
|
|
-#ifndef _MSC_VER
|
|
+#ifndef _WIN32
|
|
__attribute__((aligned(16)))
|
|
#endif
|
|
;
|
|
diff -Naur ispc-1.27.0-orig/examples/xpu/mandelbrot/mandelbrot.cpp ispc-1.27.0/examples/xpu/mandelbrot/mandelbrot.cpp
|
|
--- ispc-1.27.0-orig/examples/xpu/mandelbrot/mandelbrot.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/xpu/mandelbrot/mandelbrot.cpp 2025-06-10 15:33:13.960290800 +0300
|
|
@@ -4,7 +4,7 @@
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define _CRT_SECURE_NO_WARNINGS
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
diff -Naur ispc-1.27.0-orig/examples/xpu/noise/noise.cpp ispc-1.27.0/examples/xpu/noise/noise.cpp
|
|
--- ispc-1.27.0-orig/examples/xpu/noise/noise.cpp 2025-05-16 01:24:52.000000000 +0300
|
|
+++ ispc-1.27.0/examples/xpu/noise/noise.cpp 2025-06-10 15:33:13.960290800 +0300
|
|
@@ -3,7 +3,7 @@
|
|
|
|
SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
-#ifdef _MSC_VER
|
|
+#ifdef _WIN32
|
|
#define NOMINMAX
|
|
#pragma warning(disable : 4244)
|
|
#pragma warning(disable : 4305)
|