- 
                Notifications
    You must be signed in to change notification settings 
- Fork 929
Refs open-mpi/ompi#627. Fix support for multi-threads with CUDA 7.0 #783
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
          
     Merged
      
      
    
      
        
          +17
        
        
          −16
        
        
          
        
      
    
  
  
     Merged
                    Changes from all commits
      Commits
    
    
  File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this overwrite the value of
memCtx? If so, what's the point of filling it in lines 1749 and 1754? I ask because you specifically changed lines 1749 and 1754 to use the new variablememCtx...More generally, after reading this patch a few times, I'm not sure what the difference is between
ctxandmemCtx-- it seems like they're used mutually exclusively, and therefore you don't really need 2 variables. I don't really care, mind you -- this is your code, and if you want 2 variables just to make the code more readable, that's cool. 😄 But I figured I'd ask: is there a reason to have 2 variables for the code logic? Or is it just to make the code more readable?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They are two different code paths based on OPAL_CUDA_GET_ATTRIBUTES. With OPAL_CUDA_GET_ATTRIBUTES set, we fill in the memCtx variable with a single call that is also filling in two other pieces of information. Without OPAL_CUDA_GET_ATTRIBUTES, we have to make a specific call for memCtx. Also, I need the two variables because when I do have OPAL_CUDA_GET_ATTRIBUTES, I have previously saved the memCtx variable. I agree that when we do not have OPAL_CUDA_GET_ATTRIBUTES, we do not need memCtx. But, that is what this bug is fixing. Making things work with OPAL_CUDA_GET_ATTRIBUTES set.
So, the general idea is that we put the memory context into memCtx and the current context into ctx. Does that make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool.