llm.c icon indicating copy to clipboard operation
llm.c copied to clipboard

use const properly, esp in function signatures

Open karpathy opened this issue 1 year ago • 1 comments

I wasn't diligent enough with my use of float* vs const float*. The former is used for outputs, the latter for inputs, to all functions. We'd like to refactor the function declarations to follow this paradigm, to be more defensive.

karpathy avatar Apr 16 '24 06:04 karpathy

This one?

int check_tensor(float *a, float b, int n, const char label) { this one generates a couple of warnings

test_gpt2.cu(139): warning #2464-D: conversion from a string literal to "char *" is deprecated test_gpt2.cu(141): warning #2464-D: conversion from a string literal to "char *" is deprecated

There's also these but wasn't sure if there's some incoming changes to use these variables?

test_gpt2.cu(56): warning #177-D: variable "maxT" was declared but never referenced test_gpt2.cu(57): warning #177-D: variable "L" was declared but never referenced test_gpt2.cu(95): warning C4101: 'losses': unreferenced local variable

rosslwheeler avatar Apr 17 '24 01:04 rosslwheeler