2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
SET(sources
|
|
|
|
kernel.cpp
|
|
|
|
kernel.cl
|
|
|
|
kernel.cu)
|
|
|
|
|
|
|
|
SET(headers
|
|
|
|
kernel.h
|
|
|
|
kernel_bvh.h
|
|
|
|
kernel_camera.h
|
|
|
|
kernel_compat_cpu.h
|
|
|
|
kernel_compat_cuda.h
|
|
|
|
kernel_compat_opencl.h
|
|
|
|
kernel_differential.h
|
|
|
|
kernel_displace.h
|
|
|
|
kernel_emission.h
|
|
|
|
kernel_film.h
|
|
|
|
kernel_globals.h
|
|
|
|
kernel_light.h
|
|
|
|
kernel_math.h
|
|
|
|
kernel_mbvh.h
|
|
|
|
kernel_montecarlo.h
|
|
|
|
kernel_object.h
|
|
|
|
kernel_path.h
|
|
|
|
kernel_qbvh.h
|
|
|
|
kernel_random.h
|
|
|
|
kernel_shader.h
|
2011-05-20 12:26:01 +00:00
|
|
|
kernel_textures.h
|
2011-04-27 11:58:34 +00:00
|
|
|
kernel_triangle.h
|
2011-05-20 12:26:01 +00:00
|
|
|
kernel_types.h)
|
|
|
|
|
|
|
|
SET(svm_headers
|
2011-04-27 11:58:34 +00:00
|
|
|
svm/bsdf.h
|
|
|
|
svm/bsdf_ashikhmin_velvet.h
|
|
|
|
svm/bsdf_diffuse.h
|
|
|
|
svm/bsdf_microfacet.h
|
|
|
|
svm/bsdf_reflection.h
|
|
|
|
svm/bsdf_refraction.h
|
|
|
|
svm/bsdf_transparent.h
|
|
|
|
svm/bsdf_ward.h
|
|
|
|
svm/bsdf_westin.h
|
|
|
|
svm/emissive.h
|
|
|
|
svm/svm.h
|
|
|
|
svm/svm_attribute.h
|
|
|
|
svm/svm_blend.h
|
|
|
|
svm/svm_bsdf.h
|
|
|
|
svm/svm_closure.h
|
|
|
|
svm/svm_clouds.h
|
|
|
|
svm/svm_convert.h
|
|
|
|
svm/svm_displace.h
|
|
|
|
svm/svm_distorted_noise.h
|
|
|
|
svm/svm_fresnel.h
|
|
|
|
svm/svm_geometry.h
|
|
|
|
svm/svm_image.h
|
|
|
|
svm/svm_light_path.h
|
|
|
|
svm/svm_magic.h
|
|
|
|
svm/svm_mapping.h
|
|
|
|
svm/svm_marble.h
|
|
|
|
svm/svm_math.h
|
|
|
|
svm/svm_mix.h
|
|
|
|
svm/svm_musgrave.h
|
|
|
|
svm/svm_noise.h
|
|
|
|
svm/svm_noisetex.h
|
|
|
|
svm/svm_sky.h
|
|
|
|
svm/svm_stucci.h
|
|
|
|
svm/svm_tex_coord.h
|
|
|
|
svm/svm_texture.h
|
|
|
|
svm/svm_types.h
|
|
|
|
svm/svm_value.h
|
|
|
|
svm/svm_voronoi.h
|
|
|
|
svm/svm_wood.h
|
|
|
|
svm/volume.h
|
|
|
|
)
|
|
|
|
|
|
|
|
# CUDA module
|
|
|
|
|
2011-05-04 09:58:02 +00:00
|
|
|
IF("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
|
|
|
|
SET(CUDA_BITS 64)
|
|
|
|
ELSE()
|
|
|
|
SET(CUDA_BITS 32)
|
|
|
|
ENDIF()
|
|
|
|
|
2011-04-28 13:47:27 +00:00
|
|
|
IF(WITH_CYCLES_CUDA)
|
2011-05-20 12:26:01 +00:00
|
|
|
SET(cuda_sources kernel.cu ${headers} ${svm_headers})
|
2011-04-27 11:58:34 +00:00
|
|
|
SET(cuda_cubins)
|
|
|
|
|
2011-04-28 13:47:27 +00:00
|
|
|
FOREACH(arch ${CYCLES_CUDA_ARCH})
|
2011-04-27 11:58:34 +00:00
|
|
|
SET(cuda_cubin kernel_${arch}.cubin)
|
|
|
|
|
|
|
|
ADD_CUSTOM_COMMAND(
|
|
|
|
OUTPUT ${cuda_cubin}
|
2011-05-04 09:58:02 +00:00
|
|
|
COMMAND ${CUDA_NVCC} -arch=${arch} -m${CUDA_BITS} --cubin ${CMAKE_CURRENT_SOURCE_DIR}/kernel.cu --use_fast_math -o ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} --ptxas-options="-v" --maxrregcount=${CYCLES_CUDA_MAXREG} --opencc-options -OPT:Olimit=0 -I${CMAKE_CURRENT_SOURCE_DIR}/../util -I${CMAKE_CURRENT_SOURCE_DIR}/svm -DCCL_NAMESPACE_BEGIN= -DCCL_NAMESPACE_END= -DNVCC
|
2011-04-27 11:58:34 +00:00
|
|
|
DEPENDS ${cuda_sources})
|
|
|
|
|
2011-04-28 13:47:27 +00:00
|
|
|
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${cuda_cubin} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/lib)
|
2011-04-27 11:58:34 +00:00
|
|
|
LIST(APPEND cuda_cubins ${cuda_cubin})
|
|
|
|
ENDFOREACH()
|
|
|
|
|
2011-04-28 13:47:27 +00:00
|
|
|
ADD_CUSTOM_TARGET(cycles_kernel_cuda ALL DEPENDS ${cuda_cubins})
|
|
|
|
ENDIF()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# OSL module
|
|
|
|
|
2011-04-28 13:47:27 +00:00
|
|
|
IF(WITH_CYCLES_OSL)
|
2011-04-27 11:58:34 +00:00
|
|
|
ADD_SUBDIRECTORY(osl)
|
2011-04-28 13:47:27 +00:00
|
|
|
ENDIF()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
# CPU module
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(. ../util osl svm)
|
|
|
|
|
2011-05-20 12:26:01 +00:00
|
|
|
ADD_LIBRARY(cycles_kernel ${sources} ${headers} ${svm_headers})
|
2011-04-28 13:47:27 +00:00
|
|
|
|
|
|
|
IF(WITH_CYCLES_CUDA)
|
2011-05-01 09:19:45 +00:00
|
|
|
ADD_DEPENDENCIES(cycles_kernel cycles_kernel_cuda)
|
2011-04-28 13:47:27 +00:00
|
|
|
ENDIF()
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2011-05-20 12:26:01 +00:00
|
|
|
# OPENCL kernel
|
|
|
|
|
|
|
|
IF(WITH_CYCLES_OPENCL)
|
|
|
|
SET(util_headers
|
|
|
|
../util/util_color.h
|
|
|
|
../util/util_math.h
|
|
|
|
../util/util_transform.h
|
|
|
|
../util/util_types.h)
|
|
|
|
|
|
|
|
INSTALL(FILES kernel.cl ${headers} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/kernel)
|
|
|
|
INSTALL(FILES ${svm_headers} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/kernel/svm)
|
|
|
|
INSTALL(FILES ${util_headers} DESTINATION ${CYCLES_INSTALL_PATH}/cycles/kernel)
|
|
|
|
ENDIF()
|
|
|
|
|