Skip to content

Commit

Permalink
tolerance and doc comments
Browse files Browse the repository at this point in the history
  • Loading branch information
TorreZuk committed Aug 12, 2024
1 parent 8f37a45 commit 3963a01
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
8 changes: 4 additions & 4 deletions Extensions/gemm_ex_bf16_r/gemm_ex_bf16_r.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ************************************************************************
* Copyright (C) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -34,9 +34,9 @@ int main(int argc, char** argv)
// set defaults
options.M = 128;
options.N = 128;
options.K = 128;
options.alpha = 2.0f;
options.beta = 3.0f;
options.K = 32;
options.alpha = 1.0f;
options.beta = 2.0f;

if(!options.validArgs(argc, argv))
return EXIT_FAILURE;
Expand Down
4 changes: 2 additions & 2 deletions Extensions/gemm_ex_f16_r/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ########################################################################
# Copyright (C) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
# Copyright (C) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
Expand Down Expand Up @@ -48,7 +48,7 @@ OPT = -g -Wall
# removing these temporarily as hipcc can not process
# -Ofast -march=native
INC = -I$(COMMON_PATH) -isystem$(ROCBLAS_PATH)/include -isystem$(ROCM_PATH)/include
CXXFLAGS = -std=c++14 $(INC) $(OPT)
CXXFLAGS = -std=c++14 $(INC) $(OPT) # -D__STDC_WANT_IEC_60559_TYPES_EXT__
ifneq ($(CXX),$(HIPCXX))
CXXFLAGS += -D__HIP_PLATFORM_AMD__
endif
Expand Down
3 changes: 3 additions & 0 deletions Extensions/gemm_ex_f16_r/gemm_ex_f16_r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,9 @@ int main(int argc, char** argv)
1,
ldd);

// example printing gold results
// helpers::printMatrix("gold", hDGold.data(), M, N, ldd);

double maxRelativeError = helpers::maxRelativeError(hD, hDGold);
double eps = std::numeric_limits<float>::epsilon();
double tolerance = 10.0 * sqrt((double)K);
Expand Down
7 changes: 4 additions & 3 deletions common/helpers.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* ************************************************************************
* Copyright (C) 2019-2023 Advanced Micro Devices, Inc. All rights reserved.
* Copyright (C) 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -21,6 +21,7 @@
* ************************************************************************ */

#pragma once

#include "ArgParser.hpp"
#include "error_macros.h"
#include "memoryHelpers.hpp"
Expand All @@ -46,7 +47,7 @@ namespace helpers
n = v.size();
for(size_t i = 0; i < n; i += inc)
{
std::cout << v[i] << " ";
std::cout << (float)v[i] << " ";
}
std::cout << "\n";
}
Expand All @@ -59,7 +60,7 @@ namespace helpers
{
for(int j = 0; j < n; j++)
{
printf("%f ", A[i + j * lda]);
printf("%f ", (float)A[i + j * lda]);
}
printf("\n");
}
Expand Down

0 comments on commit 3963a01

Please sign in to comment.