Coder Social home page Coder Social logo

Comments (5)

stotko avatar stotko commented on May 17, 2024

Does this error also occur with different host compilers (GCC, Clang) and different CUDA versions (11.3, etc.)? Furthermore, is this the only error you are getting? Or are there also errors regarding the is_signed, is_integer, etc. member variables? If possible, could you attach a (minimal) reproducable example?

from stdgpu.

geotyper avatar geotyper commented on May 17, 2024

Try only GCC and CUDA 11.4, this is my work setup.
Have 5 errors, as list of this variables:

/**
   * \brief Whether the type is signed
   */
  static constexpr bool is_signed = false;
  /**
   * \brief Whether the type is an integer
   */
  static constexpr bool is_integer = true;
  /**
   * \brief Whether the type is exact
   */
  static constexpr bool is_exact = true;
  /**
   * \brief Number of radix digits
   */
  static constexpr int digits = 1;
  /**
   * \brief Integer base
   */
  static constexpr int radix = 2;

Add in work project #include header from example vector.cu

#include <iostream>
#include <thrust/copy.h>
#include <thrust/reduce.h>
#include <thrust/sequence.h>

#include <stdgpu/memory.h>          // createDeviceArray, destroyDeviceArray
#include <stdgpu/iterator.h>        // device_begin, device_end
#include <stdgpu/platform.h>        // STDGPU_HOST_DEVICE
#include <stdgpu/vector.cuh>        // stdgpu::vector

and two lines of code

stdgpu::index_t n = 100;
int* d_input = createDeviceArray<int>(n);

In cmakelists.txt add (CUDA is active and work in project):
find_package(stdgpu REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PUBLIC stdgpu::stdgpu)

can't understand what to write in add_library(foo ... ) so don't add it
if add include_directory with path to include directory of stdgpu, errors more than 200

from stdgpu.

geotyper avatar geotyper commented on May 17, 2024

image

this errors if add include_directory with headers

from stdgpu.

stotko avatar stotko commented on May 17, 2024

if add include_directory with path to include directory of stdgpu, errors more than 200

Could you elaborate what you exactly mean by that? The lines

find_package(stdgpu REQUIRED)
target_link_libraries(${EXECUTABLE_NAME} PUBLIC stdgpu::stdgpu)

are sufficient to add all necessary properties stdgpu needs add to your project, including the include directory paths.

It seems like this is an error/incompatibility in your project. stdgpu requires compilation with C++14 and should enforce this by its imported cxx_std_14 property. Did you set the C++ standard somewhere in your project? Could you provide more details on your project? In particular, the build configuration, i.e. the CMakeLists.txt file(s), would be helpful to know (if it is possible for you to attach them).

from stdgpu.

geotyper avatar geotyper commented on May 17, 2024

Made small project to solve problem, under some changes in cmakelists.txt all work as expected:

cmake_minimum_required(VERSION 3.5)

if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
  set(CMAKE_CUDA_ARCHITECTURES 61)
  message(CMAKE_CUDA_ARCHITECTURES)
endif()

project(CellInstancing LANGUAGES CUDA CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(CMAKE_CUDA_STANDARD 14)
set(CMAKE_CUDA_STANDARD_REQUIRED ON)
set(CMAKE_CUDA_SEPARABLE_COMPILATION ON)


set(EXECUTABLE_NAME "CUDA_exp")

find_package(CUDA REQUIRED)


SET(TARGET_H
)

SET(TARGET_SRC
main.cu
)

SET(TARGET_CUDA_H
cuda_exp.cuh
)

SET(TARGET_CUDA_SRC
cuda_exp.cu
)

find_package(stdgpu REQUIRED)

set(Cuda_common_include "/usr/local/cuda/samples/common/inc")
include_directories(${Cuda_common_include})

message(${CUDA_INCLUDE_DIRS})
include_directories(${CUDA_INCLUDE_DIRS})

add_executable(${EXECUTABLE_NAME} ${TARGET_SRC} ${TARGET_H} ${TARGET_CUDA_H} ${TARGET_CUDA_SRC} )

set_target_properties(${EXECUTABLE_NAME} PROPERTIES CUDA_ARCHITECTURES "61")
target_link_libraries(${EXECUTABLE_NAME} ${CUDA_LIBRARIES})
target_link_libraries(${EXECUTABLE_NAME} stdgpu::stdgpu)

from stdgpu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.