<commit_before>jobs:

- job: Linux_C_API_Packaging_CPU_x64
  pool: Linux-CPU
  steps:
    - template: templates/linux-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory)'
      displayName: 'Build and Test Linux on Docker'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'Release'
          artifactName: 'onnxruntime-linux-x64-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
          commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml

- job: Linux_C_API_Packaging_CPU_x86
  pool: Linux-CPU
  steps:
    - template: templates/linux-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -a x86 -x "--x86"'
      displayName: 'Build and Test Linux on Docker'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'Release'
          artifactName: 'onnxruntime-linux-x86-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
          commitId: $(OnnxRuntimeGitCommitHash)          
    - template: templates/clean-agent-build-directory-step.yml

- job: Linux_C_API_Packaging_GPU_x64
  pool: Linux-GPU
  steps:
    - template: templates/linux-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d gpu -c cuda9.1-cudnn7.1 -r $(Build.BinariesDirectory)'
      displayName: 'Build and Test Linux on Docker'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'Release'
          artifactName: 'onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
          commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml
 

- job: MacOS_C_API_Packaging_CPU_x64
  pool: 
    vmImage: 'macOS-10.13'
  steps:
  
    - template: templates/mac-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: |
        sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
        python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config RelWithDebInfo --enable_onnx_tests
      displayName: 'Build and Test MacOS'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'RelWithDebInfo'
          artifactName: 'onnxruntime-osx-x64-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.$(OnnxRuntimeVersion).dylib'
          commitId: $(OnnxRuntimeGitCommitHash)
          
    - template: templates/clean-agent-build-directory-step.yml


- job: Windows_Packaging_CPU_x64
  pool: 'Win-CPU'
  variables:
    buildDirectory: '$(Build.BinariesDirectory)'
    buildConfig: 'RelWithDebInfo'
    buildArch: 'x64'

  steps:
    - template: templates/set-test-data-variables-step.yml
    - template: templates/set-version-number-variables-step.yml

    - template: templates/windows-build-tools-setup-steps.yml
      parameters:
        EnvSetupScript: 'setup_env.bat'
        buildArch: 'amd64'  # amd64 is needed for vcvars target arch 
        setVcvars: false

    - template: templates/windows-build-and-test-steps.yml
      parameters:
        buildAdditionalParams: ' --use_openmp '
        buildArch: $(buildArch)
        msbuildPlatform: $(buildArch)
        buildConfig: $(buildConfig)

    - template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
      parameters:
        buildConfig: $(buildConfig)
        artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
        commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml


- job: Windows_Packaging_CPU_x86
  pool: 'Win-CPU'
  variables:
    buildDirectory: '$(Build.BinariesDirectory)'
    buildConfig: 'RelWithDebInfo'
    buildArch: 'x86'

  steps:
    - template: templates/set-test-data-variables-step.yml
    - template: templates/set-version-number-variables-step.yml

    - template: templates/windows-build-tools-setup-steps.yml
      parameters:
        EnvSetupScript: 'setup_env.bat'
        buildArch: $(buildArch)
        setVcVars: false

    - template: templates/windows-build-and-test-steps.yml
      parameters:
        buildAdditionalParams: ' --use_openmp --x86 '
        buildArch: $(buildArch)
        msbuildPlatform: 'Win32'
        buildConfig: $(buildConfig)

    - template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
      parameters:
        buildConfig: $(buildConfig)
        artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
        commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml


- job: Windows_Packaging_GPU_x64
  pool: 'Win-GPU'
  variables:
    buildDirectory: '$(Build.BinariesDirectory)'
    buildConfig: 'RelWithDebInfo'
    buildArch: 'x64'

  steps:
    - template: templates/set-test-data-variables-step.yml
    - template: templates/set-version-number-variables-step.yml

    - task: CmdLine@2
      displayName: 'Set CUDA 9.1 path'
      inputs:
        script: |
          set PATH=C:\local\cuda-9.1.85-windows10-x64-0\bin;C:\local\cudnn-9.1-windows10-x64-v7.1\cuda\bin;%PATH%
        modifyEnvironment: true
        workingDirectory: '$(Build.BinariesDirectory)'

    - task: PowerShell@2
      displayName: 'Set CUDA 9.1 MSBuild properties'
      inputs:
        targetType: 'filePath'
        filePath: '$(Build.SourcesDirectory)/tools/ci_build/github/windows/set_cuda_path.ps1'
        arguments: '-CudaMsbuildPath C:\local\cudaMsbuildIntegration-9.1.85-windows10-x64-0 -CudaVersion 9.1'

    - template: templates/windows-build-tools-setup-steps.yml
      parameters:
        EnvSetupScript: 'setup_env.bat'
        buildArch: 'amd64'  # amd64 is needed for vcvars target arch
        setVcvars: true

    - task: CmdLine@2
      displayName: 'Build and Test OnnxRuntime'
      inputs:
        script: |
          $(Build.BinariesDirectory)\packages\python\python.exe $(Build.SourcesDirectory)\tools\ci_build\build.py --config $(buildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --cmake_path $(Build.BinariesDirectory)\cmake\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake\bin\ctest.exe --enable_onnx_tests --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum) --use_openmp --msvc_toolset=14.11 --use_cuda --cuda_version 9.1 --cuda_home="C:\local\cuda-9.1.85-windows10-x64-0" --cudnn_home="C:\local\cudnn-9.1-windows10-x64-v7.1\cuda" 
        workingDirectory: '$(Build.BinariesDirectory)'

    - template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
      parameters:
        buildConfig: $(buildConfig)
        artifactName: 'onnxruntime-win-$(buildArch)-gpu-$(OnnxRuntimeVersion)'
        commitId: $(OnnxRuntimeGitCommitHash)

    - template: templates/clean-agent-build-directory-step.yml
<commit_msg>Update C-API packaging pipeline to use CUDa 10 (#1445)<commit_after>jobs:

- job: Linux_C_API_Packaging_CPU_x64
  pool: Linux-CPU
  steps:
    - template: templates/linux-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory)'
      displayName: 'Build and Test Linux on Docker'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'Release'
          artifactName: 'onnxruntime-linux-x64-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
          commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml

- job: Linux_C_API_Packaging_CPU_x86
  pool: Linux-CPU
  steps:
    - template: templates/linux-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d cpu -r $(Build.BinariesDirectory) -a x86 -x "--x86"'
      displayName: 'Build and Test Linux on Docker'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'Release'
          artifactName: 'onnxruntime-linux-x86-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
          commitId: $(OnnxRuntimeGitCommitHash)          
    - template: templates/clean-agent-build-directory-step.yml

- job: Linux_C_API_Packaging_GPU_x64
  pool: Linux-GPU
  steps:
    - template: templates/linux-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: 'tools/ci_build/github/linux/run_dockerbuild.sh -o ubuntu16.04 -d gpu -r $(Build.BinariesDirectory)'
      displayName: 'Build and Test Linux on Docker'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'Release'
          artifactName: 'onnxruntime-linux-x64-gpu-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.so.$(OnnxRuntimeVersion)'
          commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml
 

- job: MacOS_C_API_Packaging_CPU_x64
  pool: 
    vmImage: 'macOS-10.13'
  steps:
  
    - template: templates/mac-set-variables-and-download.yml
    - template: templates/set-version-number-variables-step.yml

    - script: |
        sudo xcode-select --switch /Applications/Xcode_10.app/Contents/Developer
        python3 $(Build.SourcesDirectory)/tools/ci_build/build.py --use_openmp --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --parallel --build_shared_lib --config RelWithDebInfo --enable_onnx_tests
      displayName: 'Build and Test MacOS'
    - template: templates/c-api-artifacts-package-and-publish-steps-posix.yml
      parameters:
          buildConfig: 'RelWithDebInfo'
          artifactName: 'onnxruntime-osx-x64-$(OnnxRuntimeVersion)'
          libraryName: 'libonnxruntime.$(OnnxRuntimeVersion).dylib'
          commitId: $(OnnxRuntimeGitCommitHash)
          
    - template: templates/clean-agent-build-directory-step.yml


- job: Windows_Packaging_CPU_x64
  pool: 'Win-CPU'
  variables:
    buildDirectory: '$(Build.BinariesDirectory)'
    buildConfig: 'RelWithDebInfo'
    buildArch: 'x64'

  steps:
    - template: templates/set-test-data-variables-step.yml
    - template: templates/set-version-number-variables-step.yml

    - template: templates/windows-build-tools-setup-steps.yml
      parameters:
        EnvSetupScript: 'setup_env.bat'
        buildArch: 'amd64'  # amd64 is needed for vcvars target arch 
        setVcvars: false

    - template: templates/windows-build-and-test-steps.yml
      parameters:
        buildAdditionalParams: ' --use_openmp '
        buildArch: $(buildArch)
        msbuildPlatform: $(buildArch)
        buildConfig: $(buildConfig)

    - template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
      parameters:
        buildConfig: $(buildConfig)
        artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
        commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml


- job: Windows_Packaging_CPU_x86
  pool: 'Win-CPU'
  variables:
    buildDirectory: '$(Build.BinariesDirectory)'
    buildConfig: 'RelWithDebInfo'
    buildArch: 'x86'

  steps:
    - template: templates/set-test-data-variables-step.yml
    - template: templates/set-version-number-variables-step.yml

    - template: templates/windows-build-tools-setup-steps.yml
      parameters:
        EnvSetupScript: 'setup_env.bat'
        buildArch: $(buildArch)
        setVcVars: false

    - template: templates/windows-build-and-test-steps.yml
      parameters:
        buildAdditionalParams: ' --use_openmp --x86 '
        buildArch: $(buildArch)
        msbuildPlatform: 'Win32'
        buildConfig: $(buildConfig)

    - template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
      parameters:
        buildConfig: $(buildConfig)
        artifactName: 'onnxruntime-win-$(buildArch)-$(OnnxRuntimeVersion)'
        commitId: $(OnnxRuntimeGitCommitHash)
    - template: templates/clean-agent-build-directory-step.yml


- job: Windows_Packaging_GPU_x64
  pool: 'Win-GPU'
  variables:
    buildDirectory: '$(Build.BinariesDirectory)'
    buildConfig: 'RelWithDebInfo'
    buildArch: 'x64'

  steps:
    - template: templates/set-test-data-variables-step.yml
    - template: templates/set-version-number-variables-step.yml

    - template: templates/windows-build-tools-setup-steps.yml
      parameters:
        EnvSetupScript: 'setup_env.bat'
        buildArch: 'amd64'  # amd64 is needed for vcvars target arch
        setVcvars: true

    - task: CmdLine@2
      displayName: 'Build and Test OnnxRuntime'
      inputs:
        script: |
          $(Build.BinariesDirectory)\packages\python\python.exe $(Build.SourcesDirectory)\tools\ci_build\build.py --config $(buildConfig) --build_dir $(Build.BinariesDirectory) --skip_submodule_sync --build_shared_lib --cmake_path $(Build.BinariesDirectory)\cmake\bin\cmake.exe --ctest_path $(Build.BinariesDirectory)\cmake\bin\ctest.exe --enable_onnx_tests --test_data_url $(TestDataUrl) --test_data_checksum $(TestDataChecksum) --use_openmp --msvc_toolset=14.11 --use_cuda  --cuda_home="C:\local\cuda_10.0.130_win10" --cudnn_home="C:\local\cudnn-10.0-windows10-x64-v7.3.1.20\cuda"
        workingDirectory: '$(Build.BinariesDirectory)'

    - template: templates/c-api-artifacts-package-and-publish-steps-windows.yml
      parameters:
        buildConfig: $(buildConfig)
        artifactName: 'onnxruntime-win-$(buildArch)-gpu-$(OnnxRuntimeVersion)'
        commitId: $(OnnxRuntimeGitCommitHash)

    - template: templates/clean-agent-build-directory-step.yml

{'fraction_non_alphanumeric': 0.12052005228038798, 'fraction_numerical': 0.0151337965192268, 'mean_word_length': 3.1956709956709957, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 10, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3872966', 'n_tokens_mistral': 4865, 'n_tokens_neox': 4576, 'n_words': 721}