Cycles: More fixes after include changes

This commit is contained in:
Mai Lavelle 2017-03-31 10:12:13 +02:00 committed by Sergey Sharybin
parent d097c2a1b3
commit 4b7d95290f
3 changed files with 15 additions and 13 deletions

@ -300,8 +300,8 @@ public:
{
const int cuda_version = cuewCompilerVersion();
const int machine = system_cpu_bits();
const string kernel_path = path_get("source/kernel");
const string include = path_dirname(kernel_path);
const string source_path = path_get("source");
const string include_path = source_path;
string cflags = string_printf("-m%d "
"--ptxas-options=\"-v\" "
"--use_fast_math "
@ -310,7 +310,7 @@ public:
"-I\"%s\"",
machine,
cuda_version,
include.c_str());
include_path.c_str());
if(use_adaptive_compilation()) {
cflags += " " + requested_features.get_build_options();
}
@ -382,8 +382,8 @@ public:
compile_kernel_get_common_cflags(requested_features, split);
/* Try to use locally compiled kernel. */
const string kernel_path = path_get("source/kernel");
const string kernel_md5 = path_files_md5_hash(kernel_path);
const string source_path = path_get("source");
const string kernel_md5 = path_files_md5_hash(source_path);
/* We include cflags into md5 so changing cuda toolkit or changing other
* compiler command line arguments makes sure cubin gets re-built.
@ -424,9 +424,10 @@ public:
return "";
}
const char *nvcc = cuewCompilerPath();
const string kernel = path_join(kernel_path,
path_join("kernels",
path_join("cuda", split ? "kernel_split.cu" : "kernel.cu")));
const string kernel = path_join(
path_join(source_path, "kernel"),
path_join("kernels",
path_join("cuda", split ? "kernel_split.cu" : "kernel.cu")));
double starttime = time_dt();
printf("Compiling CUDA kernel ...\n");

@ -235,7 +235,7 @@ string OpenCLCache::get_kernel_md5()
thread_scoped_lock lock(self.kernel_md5_lock);
if(self.kernel_md5.empty()) {
self.kernel_md5 = path_files_md5_hash(path_get("source/kernel"));
self.kernel_md5 = path_files_md5_hash(path_get("source"));
}
return self.kernel_md5;
}

@ -320,17 +320,18 @@ static char *path_specials(const string& sub)
{
static bool env_init = false;
static char *env_shader_path;
static char *env_kernel_path;
static char *env_source_path;
if(!env_init) {
env_shader_path = getenv("CYCLES_SHADER_PATH");
env_kernel_path = getenv("CYCLES_KERNEL_PATH");
/* NOTE: It is KERNEL in env variable for compatibility reasons. */
env_source_path = getenv("CYCLES_KERNEL_PATH");
env_init = true;
}
if(env_shader_path != NULL && sub == "shader") {
return env_shader_path;
}
else if(env_shader_path != NULL && sub == "kernel") {
return env_kernel_path;
else if(env_shader_path != NULL && sub == "source") {
return env_source_path;
}
return NULL;
}