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

tolerance and doc comments #98

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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