- 
                Notifications
    
You must be signed in to change notification settings  - Fork 42
 
Split initialize function and add post-initialize phase #1467
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
Conversation
54df467    to
    40c6dfc      
    Compare
  
    40c6dfc    to
    1f76309      
    Compare
  
            
          
                include/umf/memory_pool_ops.h
              
                Outdated
          
        
      | /// @param provider memory provider that will be used for coarse-grain allocations. | ||
| /// Should contain at least one memory provider. | ||
| /// @param numProvider number of elements in the providers array | ||
| /// @param params pool-specific params, or NULL for defaults | ||
| /// @param pool [out] returns pointer to the pool | ||
| /// @return UMF_RESULT_SUCCESS on success or appropriate error code on failure. | 
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.
Write better documentation
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.
Done.
        
          
                src/provider/provider_cuda.c
              
                Outdated
          
        
      | void *provider) { | ||
| (void)params; | ||
| (void)provider; | ||
| // For initial version, just return success | 
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.
since this is ext function, can't we just omit it, when not needed?
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.
+1 - this would be replaced by "default" handler during provider creation
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.
Done.
a5f6195    to
    7aca774      
    Compare
  
            
          
                src/provider/provider_cuda.c
              
                Outdated
          
        
      | void *provider) { | ||
| (void)params; | ||
| (void)provider; | ||
| // For initial version, just return success | 
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.
+1 - this would be replaced by "default" handler during provider creation
172429a    to
    1fcad79      
    Compare
  
    | /// \details | ||
| /// * This function *must* be implemented if the pool/provider supports CTL that overrides defaults. | ||
| /// * This function *must* free any resources allocated in the function. | ||
| /// * This function *must* be called after the memory pool has been allocated in initialize function | 
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.
This function *must* be called after the memory pool has been allocated in initialize function
Must be called by whom? If UMF calls it, then the comment is missleading.
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.
It's about the function order. Generally, this function is the same case as initialize(), it's also invoked in the same way - internally.
eaab2b7    to
    a3ac32a      
    Compare
  
    Split between initialize and post-initialize function is necessary for properly handling CTL defaults.
a3ac32a    to
    6fee430      
    Compare
  
    
Description
Checklist