[Bf-blender-cvs] [dc7d664] master: Remove any wrangler utility scripts

Sergey Sharybin noreply at git.blender.org
Tue Apr 12 11:07:54 CEST 2016


Commit: dc7d6643e1bd2d69be591346af3eb69fb8c06ff1
Author: Sergey Sharybin
Date:   Tue Apr 12 11:07:23 2016 +0200
Branches: master
https://developer.blender.org/rBdc7d6643e1bd2d69be591346af3eb69fb8c06ff1

Remove any wrangler utility scripts

===================================================================

M	extern/cuew/CMakeLists.txt
D	extern/cuew/auto/cuda_errors.py
D	extern/cuew/auto/cuda_extra.py
D	extern/cuew/auto/cuew_gen.py
D	extern/cuew/auto/cuew_gen.sh
D	extern/cuew/auto/stdlib.h
D	extern/sdlew/auto/sdlew_gen.sh
D	extern/sdlew/auto/strip_comments.sh

===================================================================

diff --git a/extern/cuew/CMakeLists.txt b/extern/cuew/CMakeLists.txt
index 3054650..9ba390b 100644
--- a/extern/cuew/CMakeLists.txt
+++ b/extern/cuew/CMakeLists.txt
@@ -36,9 +36,6 @@ set(SRC
 	src/cuew.c
 
 	include/cuew.h
-
-	# Only used for updating the CUDA wrangler, intentionally omit:
-	# auto/stdlib.h
 )
 
 blender_add_lib(extern_cuew "${SRC}" "${INC}" "${INC_SYS}")
diff --git a/extern/cuew/auto/cuda_errors.py b/extern/cuew/auto/cuda_errors.py
deleted file mode 100644
index 464b776..0000000
--- a/extern/cuew/auto/cuda_errors.py
+++ /dev/null
@@ -1,35 +0,0 @@
-CUDA_ERRORS={
-'CUDA_SUCCESS': "No errors",
-'CUDA_ERROR_INVALID_VALUE': "Invalid value",
-'CUDA_ERROR_OUT_OF_MEMORY': "Out of memory",
-'CUDA_ERROR_NOT_INITIALIZED': "Driver not initialized",
-'CUDA_ERROR_DEINITIALIZED': "Driver deinitialized",
-'CUDA_ERROR_NO_DEVICE': "No CUDA-capable device available",
-'CUDA_ERROR_INVALID_DEVICE': "Invalid device",
-'CUDA_ERROR_INVALID_IMAGE': "Invalid kernel image",
-'CUDA_ERROR_INVALID_CONTEXT': "Invalid context",
-'CUDA_ERROR_CONTEXT_ALREADY_CURRENT': "Context already current",
-'CUDA_ERROR_MAP_FAILED': "Map failed",
-'CUDA_ERROR_UNMAP_FAILED': "Unmap failed",
-'CUDA_ERROR_ARRAY_IS_MAPPED': "Array is mapped",
-'CUDA_ERROR_ALREADY_MAPPED': "Already mapped",
-'CUDA_ERROR_NO_BINARY_FOR_GPU': "No binary for GPU",
-'CUDA_ERROR_ALREADY_ACQUIRED': "Already acquired",
-'CUDA_ERROR_NOT_MAPPED': "Not mapped",
-'CUDA_ERROR_NOT_MAPPED_AS_ARRAY': "Mapped resource not available for access as an array",
-'CUDA_ERROR_NOT_MAPPED_AS_POINTER': "Mapped resource not available for access as a pointer",
-'CUDA_ERROR_ECC_UNCORRECTABLE': "Uncorrectable ECC error detected",
-'CUDA_ERROR_UNSUPPORTED_LIMIT': "CUlimit not supported by device",
-'CUDA_ERROR_INVALID_SOURCE': "Invalid source",
-'CUDA_ERROR_FILE_NOT_FOUND': "File not found",
-'CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND': "Link to a shared object failed to resolve",
-'CUDA_ERROR_SHARED_OBJECT_INIT_FAILED': "Shared object initialization failed",
-'CUDA_ERROR_INVALID_HANDLE': "Invalid handle",
-'CUDA_ERROR_NOT_FOUND': "Not found",
-'CUDA_ERROR_NOT_READY': "CUDA not ready",
-'CUDA_ERROR_LAUNCH_FAILED': "Launch failed",
-'CUDA_ERROR_LAUNCH_OUT_OF_RESOURCES': "Launch exceeded resources",
-'CUDA_ERROR_LAUNCH_TIMEOUT': "Launch exceeded timeout",
-'CUDA_ERROR_LAUNCH_INCOMPATIBLE_TEXTURING': "Launch with incompatible texturing",
-'CUDA_ERROR_UNKNOWN': "Unknown error",
-}
diff --git a/extern/cuew/auto/cuda_extra.py b/extern/cuew/auto/cuda_extra.py
deleted file mode 100644
index 5fd2c17..0000000
--- a/extern/cuew/auto/cuda_extra.py
+++ /dev/null
@@ -1,125 +0,0 @@
-extra_code = """
-static void path_join(const char *path1,
-                      const char *path2,
-                      int maxlen,
-                      char *result) {
-#if defined(WIN32) || defined(_WIN32)
-  const char separator = '\\\\';
-#else
-  const char separator = '/';
-#endif
-  int n = snprintf(result, maxlen, "%s%c%s", path1, separator, path2);
-  if (n != -1 && n < maxlen) {
-    result[n] = '\\0';
-  }
-  else {
-    result[maxlen - 1] = '\\0';
-  }
-}
-
-static int path_exists(const char *path) {
-  struct stat st;
-  if (stat(path, &st)) {
-    return 0;
-  }
-  return 1;
-}
-
-const char *cuewCompilerPath(void) {
-#ifdef _WIN32
-  const char *defaultpaths[] = {"C:/CUDA/bin", NULL};
-  const char *executable = "nvcc.exe";
-#else
-  const char *defaultpaths[] = {
-    "/Developer/NVIDIA/CUDA-5.0/bin",
-    "/usr/local/cuda-5.0/bin",
-    "/usr/local/cuda/bin",
-    "/Developer/NVIDIA/CUDA-6.0/bin",
-    "/usr/local/cuda-6.0/bin",
-    "/Developer/NVIDIA/CUDA-5.5/bin",
-    "/usr/local/cuda-5.5/bin",
-    NULL};
-  const char *executable = "nvcc";
-#endif
-  int i;
-
-  const char *binpath = getenv("CUDA_BIN_PATH");
-
-  static char nvcc[65536];
-
-  if (binpath) {
-    path_join(binpath, executable, sizeof(nvcc), nvcc);
-    if (path_exists(nvcc))
-      return nvcc;
-  }
-
-  for (i = 0; defaultpaths[i]; ++i) {
-    path_join(defaultpaths[i], executable, sizeof(nvcc), nvcc);
-    if (path_exists(nvcc))
-      return nvcc;
-  }
-
-#ifndef _WIN32
-  {
-    FILE *handle = popen("which nvcc", "r");
-    if (handle) {
-      char buffer[4096] = {0};
-      int len = fread(buffer, 1, sizeof(buffer) - 1, handle);
-      buffer[len] = '\\0';
-      pclose(handle);
-
-      if (buffer[0])
-        return "nvcc";
-    }
-  }
-#endif
-
-  return NULL;
-}
-
-int cuewCompilerVersion(void) {
-  const char *path = cuewCompilerPath();
-  const char *marker = "Cuda compilation tools, release ";
-  FILE *pipe;
-  int major, minor;
-  char *versionstr;
-  char buf[128];
-  char output[65536] = "\\0";
-  char command[65536] = "\\0";
-
-  if (path == NULL)
-    return 0;
-
-  /* get --version output */
-  strncpy(command, path, sizeof(command));
-  strncat(command, " --version", sizeof(command) - strlen(path));
-  pipe = popen(command, "r");
-  if (!pipe) {
-    fprintf(stderr, "CUDA: failed to run compiler to retrieve version");
-    return 0;
-  }
-
-  while (!feof(pipe)) {
-    if (fgets(buf, sizeof(buf), pipe) != NULL) {
-      strncat(output, buf, sizeof(output) - strlen(output) - 1);
-    }
-  }
-
-  pclose(pipe);
-
-  /* parse version number */
-  versionstr = strstr(output, marker);
-  if (versionstr == NULL) {
-    fprintf(stderr, "CUDA: failed to find version number in:\\n\\n%s\\n", output);
-    return 0;
-  }
-  versionstr += strlen(marker);
-
-  if (sscanf(versionstr, "%d.%d", &major, &minor) < 2) {
-    fprintf(stderr, "CUDA: failed to parse version number from:\\n\\n%s\\n", output);
-    return 0;
-  }
-
-  return 10 * major + minor;
-}
-"""
diff --git a/extern/cuew/auto/cuew_gen.py b/extern/cuew/auto/cuew_gen.py
deleted file mode 100644
index 6cc48e4..0000000
--- a/extern/cuew/auto/cuew_gen.py
+++ /dev/null
@@ -1,640 +0,0 @@
-#!/usr/bin/env python3
-#
-# Copyright 2014 Blender Foundation
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License
-
-# This script generates either header or implementation file from
-# a CUDA header files.
-#
-# Usage: cuew hdr|impl [/path/to/cuda/includes]
-#  - hdr means header file will be generated and printed to stdout.
-#  - impl means implementation file will be generated and printed to stdout.
-#  - /path/to/cuda/includes is a path to a folder with cuda.h and cudaGL.h
-#    for which wrangler will be generated.
-
-import os
-import sys
-from cuda_errors import CUDA_ERRORS
-from pycparser import c_parser, c_ast, parse_file
-from subprocess import Popen, PIPE
-
-INCLUDE_DIR = "/usr/include"
-LIB = "CUEW"
-REAL_LIB = "CUDA"
-VERSION_MAJOR = "1"
-VERSION_MINOR = "2"
-COPYRIGHT = """/*
- * Copyright 2011-2014 Blender Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License
- */"""
-FILES = ["cuda.h", "cudaGL.h", 'nvrtc.h']
-
-TYPEDEFS = []
-FUNC_TYPEDEFS = []
-SYMBOLS = []
-DEFINES = []
-DEFINES_V2 = []
-ERRORS = []
-
-
-class FuncDefVisitor(c_ast.NodeVisitor):
-    indent = 0
-    prev_complex = False
-    dummy_typedefs = ['size_t', 'CUdeviceptr']
-
-    def _get_quals_string(self, node):
-        if node.quals:
-            return ' '.join(node.quals) + ' '
-        return ''
-
-    def _get_ident_type(self, node):
-        if isinstance(node, c_ast.PtrDecl):
-            return self._get_ident_type(node.type.type) + '*'
-        if isinstance(node, c_ast.ArrayDecl):
-            return self._get_ident_type(node.type)
-        elif isinstance(node, c_ast.Struct):
-            if node.name:
-                return 'struct ' + node.name
-            else:
-                self.indent += 1
-                struct = self._stringify_struct(node)
-                self.indent -= 1
-                return "struct {\n" + \
-                       struct + ("  " * self.indent) + "}"
-        elif isinstance(node, c_ast.Union):
-            self.indent += 1
-            union = self._stringify_struct(node)
-            self.indent -= 1
-            return "union {\n" + union + ("  " * self.indent) + "}"
-        elif isinstance(node, c_ast.Enum):
-            if node.name is not None:
-                return 'enum ' + node.name
-            else:
-                return 'enum '
-        elif isinstance(node, c_ast.TypeDecl):
-            return self._get_ident_type(node.type)
-        else:
-            return node.names[0]
-
-    def _stringify_param(self, param):
-        param_type = param.type
-        result = self._get_quals_string(param)
-        result += self._get_ident_type(param_type)
-        if param.name:
-            result += ' ' + param.name
-        if isinstance(param_type, c_ast.ArrayDecl):
-            # TODO(sergey): Workaround to deal with the
-            # preprocessed file where array size got
-            # substituded.
-            dim = param_type.dim.value
-            if param.name == "reserved" and dim == "64":
-                dim = "CU_IPC_HANDLE_SIZE"
-            result += '[' + dim + ']'
-        return result
-
-    def _stringify_params(self, params):
-        result = []
-        for param in params:
-            result.append(self._stringify_param(param))
-        return ', '.join(result)
-
-    def _stringify_struct(self, node):
-        result = ""
-        children = node.children()

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list