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

Updated C wrapper wrt. Torch v1.10 #61

Merged
merged 12 commits into from
Aug 8, 2024

Commits on Nov 12, 2023

  1. Configuration menu
    Copy the full SHA
    28550c8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    57ded88 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f374bf6 View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2024

  1. Configuration menu
    Copy the full SHA
    7828132 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0b551ea View commit details
    Browse the repository at this point in the history

Commits on Apr 29, 2024

  1. Configuration menu
    Copy the full SHA
    f82525a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    075ecf7 View commit details
    Browse the repository at this point in the history
  3. Changed return type of functions to status code

    A. Non-void, non-* methods.
    
    Search/replace:
    
    1. torch_api.h: ^(?!void)(\w+) (at.+)\( -> int $2($1 *,
    2. torch_api.h: , \);$ -> );
    3. torch_api.cpp: ^(?!void)(\w+) (at.+)\( -> int $2($1 *out__,
    4. torch_api.cpp: , \) \{$ -> ) {
    
    B. void-methods.
    
    Search/replace
    
    1. torch_api.{h,cpp}: ^void (at.+)\( -> int $1(
    
    C. *-methods.
    
    Search/replace
    1. torch.api.h: ^(\w+ \*)(at.+)\( -> int $2($1*,
    2. torch_api.cpp: ^(\w+ \*)(at.+)\( -> int $2($1*out__,
    
    D. Implemented return status code
    
    Replaced
    ```
    ^(\s*)  return new (.+)
    \s*\)
    \s*return nullptr;
    ```
    with
    ```
    $1  out__[0] = new $2
    $1  return 0;
    $1)
    $1return 1;
    ```
    
    E. Implemented return status code
    
    1. Replaced
    ```
    ^(\s*)PROTECT\(return new (.+)\)
    \s*return nullptr;
    ```
    with
    ```
    $1PROTECT(
    $1  out__[0] = new $2
    $1  return 0;
    $1)
    $1return 1;
    ```
    
    F. Implemented return status code
    
    1. Replaced
    ```
    ^(\s*)PROTECT\(return (.+)\)
    ```
    with
    ```
    $1PROTECT(
    $1  out__[0] = $2
    $1  return 0;
    $1)
    ```
    
    G. Implemented return status code
    
    1. Replaced
    ```
    ^(\s*)  return (.+)
    \s*\)
    \s*return nullptr;
    ```
    with
    ```
    $1  out__[0] = $2
    $1  return 0;
    $1)
    $1return 1;
    ```
    
    H. Restored error handling
    
    Handled caml_failwith by search/replace: Replaced:
    ```
    $
    ^(\s*)  caml_failwith\((.+)
    ```
    with:
    ```
     {
    $1  myerr = strdup($2
    $1  return 1;
    $1}
    ```
    
    I. Replaced
    ```
    ^(\s+)PROTECT\(
        return (.+)
      \)
    ```
    with
    ```
    $1PROTECT(
    $1  out__[0] = $2
    $1  return 0;
    $1)
    ```
    
    J. Manual implement return status code
    
    K. Changed return code from -1 to 1 to reduce diff
    
    L. Fixed a couple of warnings
    stemann committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    b24c65a View commit details
    Browse the repository at this point in the history
  4. Restored Julia-specific additions

    Also, made CUDA build optional.
    
    int at_empty_cache();
    int at_no_grad(int flag);
    int at_sync();
    int at_from_blob(tensor *, void *data, int64_t *dims, int ndims, int64_t *strides, int nstrides, int dev);
    stemann committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    ece9654 View commit details
    Browse the repository at this point in the history
  5. Dev. container: Added support for CUDA and CUDNN

    Also:
    * Dev. container: Updated for Torch 1.10.2
    * Added /build to .gitignore
    stemann committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    c8f1e9c View commit details
    Browse the repository at this point in the history
  6. Added GitHub Actions workflow for building C Wrapper

    Factored out scripts - for re-use in CI and dev. container.
    stemann committed Apr 29, 2024
    Configuration menu
    Copy the full SHA
    f799133 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    37c6056 View commit details
    Browse the repository at this point in the history