Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

device_type for Kokkos_Random ? #2693

Closed
kyungjoo-kim opened this issue Jan 29, 2020 · 6 comments
Closed

device_type for Kokkos_Random ? #2693

kyungjoo-kim opened this issue Jan 29, 2020 · 6 comments
Assignees
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)

Comments

@kyungjoo-kim
Copy link
Contributor

I have the following error message when I use Kokkos::Device into the random function. If I use an execution space, it is fine. However, the source code template argument name is DeviceType.

/ascldap/users/kyukim/Work/lib/trilinos/kyukim/packages/kokkos/algorithms/src/Kokkos_Random.hpp(707):                                                                    
error: class "Kokkos::Device<Kokkos::HostSpace::execution_space, Kokkos::HostSpace::memory_space>" has no member "max_hardware_threads"                                  
          detected during instantiation of "Kokkos::Random_XorShift64_Pool<DeviceType>::Random_XorShift64_Pool(uint64_t) [with DeviceType=DeviceType]"  
@dalg24
Copy link
Member

dalg24 commented Feb 14, 2020

The changes will need to be applied to Trilinos as well.

@masterleinad
Copy link
Contributor

@kyungjoo-kim Can you verify that #2761 fixes the issue for you?

@kyungjoo-kim
Copy link
Contributor Author

With the latest kokkos, it complains as follows:

/ascldap/users/kyukim/Work/lib/trilinos/kyukim/kokkos/algorithms/src/Kokkos_Random.hpp(706):            
error: class "Kokkos::Cuda" has no member "impl_max_hardware_threads"  

@dalg24
Copy link
Member

dalg24 commented Feb 25, 2020

Please post code to reproduce.

@kyungjoo-kim
Copy link
Contributor Author

The version of kokkos that I use

      1 commit a17126df906a7ec4e26d04aa2657164c463f9c79
      2 Merge: 98206b3 5308c7c
      3 Author: Christian Trott <crtrott@sandia.gov>
      4 Date:   Wed Feb 26 00:58:04 2020 -0700
      5 
      6     Merge pull request #2799 from crtrott/fix-update-copyright
      7     
      8     There is another issue in the copyright with a missed replacement.

Here is the reproducer.

#include <Kokkos_Core.hpp>                                                                              
#include <Kokkos_Random.hpp>                                                                            
                                                                                                        
int main (int argc, char *argv[]) {                                                                     
  Kokkos::initialize(argc, argv);                                                                       
  {                                                                                                     
    typedef Kokkos::Device<Kokkos::Cuda,Kokkos::CudaSpace> device_type;                                 
    typedef double value_type;                                                                          
                                                                                                        
    Kokkos::View<value_type**,device_type> A("A", 100, 100);                                            
    Kokkos::Random_XorShift64_Pool<device_type> random(13718);                                          
    Kokkos::fill_random(A, random, value_type(1));                                                      
  }                                                                                                     
  Kokkos::finalize();                                                                                   
                                                                                                        
  return 0;                                                                                             
}   

Here is the error message.

/ascldap/users/kyukim/Work/lib/trilinos/kyukim/kokkos/algorithms/src/Kokkos_Random.hpp(706):            
error: class "Kokkos::Cuda" has no member "impl_max_hardware_threads"                                   
          detected during instantiation of "Kokkos::Random_XorShift64_Pool<DeviceType>::                
Random_XorShift64_Pool(uint64_t) [with DeviceType=                                                      
Kokkos::Device<Kokkos::CudaSpace::execution_space, Kokkos::CudaSpace::memory_space>]"                   
/ascldap/users/kyukim/Work/lib/trilinos/kyukim/packages/shylu/shylu_node/tacho                          
/example/Tacho_MySmallTest.cpp(11): here                                                                
                                                                                                        
/ascldap/users/kyukim/Work/lib/trilinos/kyukim/kokkos/algorithms/src/Kokkos_Random.hpp(758):            
error: class "Kokkos::Cuda" has no member "impl_hardware_thread_id"                                     
          detected during:                                                                              
            instantiation of "Kokkos::Random_XorShift64<DeviceType>                                     
Kokkos::Random_XorShift64_Pool<DeviceType>::get_state() const                                           
[with DeviceType=Kokkos::Device<Kokkos::CudaSpace::execution_space, Kokkos::CudaSpace::memory_space>]"  
(1562): here                                                                                            
            instantiation of "void Kokkos::Impl::fill_random_functor_range                              
<ViewType, RandomPool, loops, 2, IndexType>::operator()(IndexType) const                                
[with ViewType=Kokkos::View<double **, Kokkos::Device<Kokkos::CudaSpace::execution_space,               
Kokkos::CudaSpace::memory_space>>,                                                                      
RandomPool=Kokkos::Random_XorShift64_Pool<Kokkos::Device<Kokkos::CudaSpace::execution_space,            
Kokkos::CudaSpace::memory_space>>, loops=128, IndexType=int64_t]"  

@dalg24 dalg24 self-assigned this Feb 26, 2020
@crtrott crtrott added the Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos) label Feb 26, 2020
@crtrott
Copy link
Member

crtrott commented Mar 5, 2020

@kyungjoo-kim this got fixed by #2823 which also adds testing.

@crtrott crtrott self-assigned this Mar 5, 2020
@dalg24 dalg24 closed this as completed Mar 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Broken / incorrect code; it could be Kokkos' responsibility, or others’ (e.g., Trilinos)
Projects
None yet
Development

No branches or pull requests

4 participants