Skip to content

Commit

Permalink
Make example compile again
Browse files Browse the repository at this point in the history
  • Loading branch information
stijnh committed Mar 18, 2024
1 parent 8f31b9f commit fd4eadf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions examples/vector_add/main.cu
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ __global__ void my_kernel(
int i = blockIdx.x * blockDim.x + threadIdx.x;

if (i * N < length) {
output[i] = kf::fma(input[i], input[i], kf::cast<__half>(constant));
output(i) = kf::fma(input[i], input[i], kf::cast<__half>(constant));
}
}

Expand Down Expand Up @@ -82,7 +82,7 @@ int main() {

run_kernel<1>(n);
run_kernel<2>(n);
run_kernel<3>(n);
// run_kernel<3>(n);
run_kernel<4>(n);
run_kernel<8>(n);

Expand Down
2 changes: 1 addition & 1 deletion include/kernel_float/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ struct vector_ref<T, N, const U, Align> {

#define KERNEL_FLOAT_VECTOR_REF_ASSIGN_OP(OP, OP_ASSIGN) \
template<typename T, size_t N, typename U, size_t Align, typename V> \
KERNEL_FLOAT_INLINE vector_ref<T, N> operator OP_ASSIGN( \
KERNEL_FLOAT_INLINE vector_ref<T, N, U, Align> operator OP_ASSIGN( \
vector_ref<T, N, U, Align> ptr, \
const V& value) { \
ptr.write(ptr.read() OP value); \
Expand Down
6 changes: 3 additions & 3 deletions single_include/kernel_float.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

//================================================================================
// this file has been auto-generated, do not modify its contents!
// date: 2024-02-22 10:29:30.717359
// git hash: c4fae9db85e61372cfefc53d4755b418beb2d93e
// date: 2024-03-18 16:06:55.100306
// git hash: 06e08f55399e148d96070afd0ac36dd414045f04
//================================================================================

#ifndef KERNEL_FLOAT_MACROS_H
Expand Down Expand Up @@ -2229,7 +2229,7 @@ struct concat_impl<V, Vs...> {
template<>
struct concat_impl<> {
using value_type = void;
static constexpr size_t size = 1;
static constexpr size_t size = 0;

template<typename U>
KERNEL_FLOAT_INLINE static void call(U* output) {}
Expand Down

0 comments on commit fd4eadf

Please sign in to comment.