Commit e966c23b authored by Brad King's avatar Brad King Committed by Kitware Robot
Browse files

Merge topic 'ispc-system-includes'

8da25e4a

 ISPC: Treat system includes as '-I' includes
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Merge-request: !5591
parents 7d4a6ce7 8da25e4a
......@@ -20,8 +20,6 @@ string(APPEND CMAKE_ISPC_FLAGS_RELWITHDEBINFO_INIT " -O2 -g -DNDEBUG")
set(CMAKE_ISPC_COMPILE_OPTIONS_PIE --pic)
set(CMAKE_ISPC_COMPILE_OPTIONS_PIC --pic)
set(CMAKE_INCLUDE_SYSTEM_FLAG_ISPC -isystem=)
set(CMAKE_ISPC_RESPONSE_FILE_FLAG "@")
set(CMAKE_ISPC_USE_RESPONSE_FILE_FOR_INCLUDES 1)
set(CMAKE_ISPC_USE_RESPONSE_FILE_FOR_LIBRARIES 1)
......
......@@ -13,4 +13,5 @@ add_ispc_test_macro(ISPC.ObjectGenex ISPCObjectGenex)
add_ispc_test_macro(ISPC.ObjectLibrary ISPCObjectLibrary)
add_ispc_test_macro(ISPC.ResponseAndDefine ISPCResponseAndDefine)
add_ispc_test_macro(ISPC.StaticLibrary ISPCStaticLibrary)
add_ispc_test_macro(ISPC.SystemIncludes ISPCSystemIncludes)
add_ispc_test_macro(ISPC.TryCompile ISPCTryCompile)
cmake_minimum_required(VERSION 3.18)
project(ispc_spaces_in_path ISPC CXX)
add_executable(ISPCSystemIncludes main.cxx simple.ispc)
set_target_properties(ISPCSystemIncludes PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_include_directories(ISPCSystemIncludes SYSTEM PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--target=sse2-i32x4>")
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
target_compile_options(ISPCSystemIncludes PRIVATE "$<$<COMPILE_LANGUAGE:ISPC>:--arch=x86>")
endif()
#include <stdio.h>
#include "simple.ispc.h"
int main()
{
float vin[16], vout[16];
for (int i = 0; i < 16; ++i)
vin[i] = i;
ispc::simple(vin, vout, 16);
for (int i = 0; i < 16; ++i)
printf("%d: simple(%f) = %f\n", i, vin[i], vout[i]);
}
export void simple(uniform float vin[], uniform float vout[],
uniform int count) {
foreach (index = 0 ... count) {
float v = vin[index];
v = sqrt(v);
vout[index] = v;
}
}
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