Skip to content

Commit

Permalink
Merge branch 'main' into yutji/sysinfo-runner
Browse files Browse the repository at this point in the history
  • Loading branch information
yukirora committed Jun 29, 2023
2 parents ab09dfa + 3a6622f commit 0efc70c
Show file tree
Hide file tree
Showing 12 changed files with 4,704 additions and 0 deletions.
73 changes: 73 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,76 @@ dmypy.json

# Cython debug symbols
cython_debug/

## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates

# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio 2015/2017 cache/options directory
.vs/

# Visual Studio 2017 auto generated files
Generated\ Files/

# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets

# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb

# Visual Studio code coverage results
*.coverage
*.coveragexml

# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

#pragma once

#include "../directx_utils/Options.h"

namespace Option {
enum Precision {
F16,
F32,
};
using PrecisionType = Option::Precision;
} // namespace Option

class BenchmarkOptions : public Options {
public:
// Number of warm up rounds to run.
int num_warm_up = 0;
// The number of benchmark runs.
int num_loops = 0;
// Dimension m of GEMM.
int m = 0;
// Dimension n of GEMM.
int n = 0;
// Dimension k of GEMM.
int k = 0;
// The precision of calculate.
Option::PrecisionType mode_precision = Option::F32;

/**
* @brief Construct a new GPUCoreOptions object.
*/
BenchmarkOptions(int argc, char *argv[]) : Options(argc, argv) {}

/**
* @brief Parse the arguments.
*/
virtual void parse_arguments() {

num_loops = get_cmd_line_argument_int("--num_loops", 10);
num_warm_up = get_cmd_line_argument_int("--num_loops", 0);
m = get_cmd_line_argument_int("--m", 16 * 256);
n = get_cmd_line_argument_int("--n", 16 * 256);
k = get_cmd_line_argument_int("--k", 16 * 256);
if (get_cmd_line_argument_bool("--f16")) {
mode_precision = Option::F16;
}
if (get_cmd_line_argument_bool("--f32")) {
mode_precision = Option::F32;
}
}

/**
* @brief Get the option usage.
*/
void get_option_usage() override {
std::cout << "Usage: " << std::endl;
std::cout << " --help: Print help message." << std::endl;
std::cout << " --num_loops: The number of benchmark runs." << std::endl;
std::cout << " --num_warm_up: The number of warmup runs." << std::endl;
std::cout << " --m: m dimension of GEMM." << std::endl;
std::cout << " --n: n dimension of GEMM." << std::endl;
std::cout << " --k: l dimension of GEMM." << std::endl;
std::cout << " --fp16: half precision to compute." << std::endl;
std::cout << " --fp32: float precision to compute." << std::endl;
}
};
Loading

0 comments on commit 0efc70c

Please sign in to comment.